diff --git a/iphone/Classes/ImageLoader.m b/iphone/Classes/ImageLoader.m index 55659bd3902..637f9c7c3fe 100644 --- a/iphone/Classes/ImageLoader.m +++ b/iphone/Classes/ImageLoader.m @@ -18,6 +18,10 @@ #ifdef DEBUG_IMAGE_CACHE #import #endif +@protocol TiResizableImageIOS6Support +@optional +- (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets resizingMode:(NSInteger)resizingMode; +@end @interface ImageCacheEntry : NSObject { @@ -135,7 +139,13 @@ -(UIImage *)stretchableImage if ((top + bottom) >= maxHeight) { bottom = maxHeight - (top + 1); } - stretchableImage = [[theImage resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right)] retain]; + if ([theImage respondsToSelector:@selector(resizableImageWithCapInsets:resizingMode:)]) { + //1 = UIImageResizingModeStretch + stretchableImage = [[theImage resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right) resizingMode:1] retain]; + } + else { + stretchableImage = [[theImage resizableImageWithCapInsets:UIEdgeInsetsMake(top, left, bottom, right)] retain]; + } } else {