diff --git a/UIImageViewAligned/UIImageViewAligned.m b/UIImageViewAligned/UIImageViewAligned.m index b0f332e..193c29b 100644 --- a/UIImageViewAligned/UIImageViewAligned.m +++ b/UIImageViewAligned/UIImageViewAligned.m @@ -20,7 +20,6 @@ - (id)initWithFrame:(CGRect)frame return self; } - - (id)initWithImage:(UIImage *)image { self = [super initWithImage:image]; @@ -182,17 +181,31 @@ - (CGSize)realContentSize #pragma mark - UIImageView overloads -- (void)setHighlighted:(BOOL)highlighted { +- (void)setHighlighted:(BOOL)highlighted +{ [super setHighlighted:highlighted]; self.layer.contents = nil; } +- (void)didMoveToWindow +{ + [super didMoveToSuperview]; + self.layer.contents = nil; +} + +- (void)didMoveToSuperview +{ + [super didMoveToSuperview]; + self.layer.contents = nil; +} + #pragma mark - Properties needed for Interface Builder - (BOOL)alignLeft { return (_alignment & UIImageViewAlignmentMaskLeft) != 0; } + - (void)setAlignLeft:(BOOL)alignLeft { if (alignLeft) @@ -205,6 +218,7 @@ - (BOOL)alignRight { return (_alignment & UIImageViewAlignmentMaskRight) != 0; } + - (void)setAlignRight:(BOOL)alignRight { if (alignRight) @@ -213,11 +227,11 @@ - (void)setAlignRight:(BOOL)alignRight self.alignment &= ~UIImageViewAlignmentMaskRight; } - - (BOOL)alignTop { return (_alignment & UIImageViewAlignmentMaskTop) != 0; } + - (void)setAlignTop:(BOOL)alignTop { if (alignTop) @@ -230,6 +244,7 @@ - (BOOL)alignBottom { return (_alignment & UIImageViewAlignmentMaskBottom) != 0; } + - (void)setAlignBottom:(BOOL)alignBottom { if (alignBottom)