Skip to content

Instantly share code, notes, and snippets.

@sdpjswl
Created June 11, 2015 08:41
Show Gist options
  • Save sdpjswl/c80c2b1084fbc332ffa7 to your computer and use it in GitHub Desktop.
Save sdpjswl/c80c2b1084fbc332ffa7 to your computer and use it in GitHub Desktop.
Example of how to use "resizableImageWithCapInsets" method of UIImage
- (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