0

in Objective C, for iPhone/iPad Im struggling trying to change the color (red/yellow/green) of a UIImage, in a UIButton. How can this be done. Is a subclass required? Can someone please provide an example.

i.e. this is a full single color overlay.

oberbaum
  • 2,451
  • 7
  • 36
  • 52

1 Answers1

0

If you would like to place a semi-transparent image mask on top of a UIButton (this won't exactly change the color, but can add colored shadow effects), then create a semi-transparent PNG, add it to your Supporting Files group, and then add the following line of code in some place like viewDidLoad for a view controller to add the mask on top of the UIButton:

[myButton addSubview:[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"overlay.png"]]];
Kevin Borders
  • 2,933
  • 27
  • 32