Skip to content

Commit

Permalink
[TIMOB-11255] Force resizing mode to strech
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalduggal committed Oct 8, 2012
1 parent 9535fcf commit 5d8a5ed
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion iphone/Classes/ImageLoader.m
Expand Up @@ -18,6 +18,10 @@
#ifdef DEBUG_IMAGE_CACHE
#import <mach/mach.h>
#endif
@protocol TiResizableImageIOS6Support <NSObject>
@optional
- (UIImage *)resizableImageWithCapInsets:(UIEdgeInsets)capInsets resizingMode:(NSInteger)resizingMode;
@end

@interface ImageCacheEntry : NSObject
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit 5d8a5ed

Please sign in to comment.