Skip to content

Instantly share code, notes, and snippets.

@Bayonetta
Created December 1, 2014 10:21
Show Gist options
  • Save Bayonetta/bd866d7a6951738aece6 to your computer and use it in GitHub Desktop.
Save Bayonetta/bd866d7a6951738aece6 to your computer and use it in GitHub Desktop.
Use tint color to change image color in uibutton
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
UIImage *image = [[UIImage imageNamed:@"image_name"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[button setImage:image forState:UIControlStateNormal];
button.tintColor = [UIColor yourColor];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment