sayguh sayguh - 4 years ago 198
iOS Question

Why is my UIButton.tintColor not working?

My build target is set for IOS5 which is where I understand

UIButton.tintColor
was introduced...

I have this in my viewDidLoad for the View Controller

[timelineButton setTintColor:[UIColor blackColor]];
[timelineButton setTitle:@"test" forState:UIControlStateNormal];


The text changes properly but the button isn't black?

Thanks!

Answer Source

According to the documentation:

This property is not valid for all button types.

You need to switch your buttonType to another one of these. (Unfortunately, the documentation does not specify which specific button types support this property.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download