I had the same problem, this only happened with devices with iOS5.x, resizing the UIImageView, which duplicates the UIImage created in this way:
UIEdgeInsets edgeInsets = UIEdgeInsetsMake(topCapHeight, leftCapWidth, topCapHeight, leftCapWidth); image = [originalImage resizableImageWithCapInsets:edgeInsets];
this is probably an iOS bug fixed in iOS6.x
If your case resizes the image using mirror criteria, you can use this method:
create a UIImage category and add this instance method:
- (UIImage*)resizableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight </b> { UIImage *image = nil; float osVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; if (osVersion < 6.0) { image = [self stretchableImageWithLeftCapWidth:leftCapWidth topCapHeight:topCapHeight]; } else { UIEdgeInsets edgeInsets = UIEdgeInsetsMake(topCapHeight, leftCapWidth, topCapHeight, leftCapWidth); image = [self resizableImageWithCapInsets:edgeInsets]; } return image; }
method: - (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight
deprecated in the iOS documentation, but not in the structure, this means that you can use it when launching the application on a device with iOS5.x without any problems, and the user is a new supported method with devices with iOS 6 or higher.
source share