Search code examples
iosiphoneuibuttonios8uicontrolstate

UIButton textColor for UIControlStateHighlighted in iOS8 issue


I always set the UIColor of highlighted UIButton with:

[button setTitleColor:[UIColor greenColor] forState:UIControlStateHighlighted];

But in iOS8 it doesn't work for me (and setting the UIColor in storyboard doesn't work too).

But this code works fine for iOS7.


Solution

  • Did you have the button on system style? Try change the button type to custom in Identity Inspector.