Created
June 11, 2015 08:41
-
-
Save sdpjswl/c80c2b1084fbc332ffa7 to your computer and use it in GitHub Desktop.
Example of how to use "resizableImageWithCapInsets" method of UIImage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)setResizedImageNamed:(NSString *)imageName { | |
UIEdgeInsets insets = UIEdgeInsetsMake(0, 50, 0, 5); | |
UIImage *image = [UIImage imageNamed:imageName]; | |
UIImage *buttonImage = [image resizableImageWithCapInsets:insets]; | |
[button setBackgroundImage:buttonImage forState:UIControlStateNormal]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment