Change in Button text color not reflecting
28,698
try:
[myButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[myButton setTitleColor:[UIColor colorWithRed:150.0/256.0 green:150.0/256.0 blue:150.0/256.0 alpha:1.0] forState:UIControlStateHighlighted];
Color components are floats between 0.0 and 1.0 !
Author by
Abhinav
Updated on May 21, 2020Comments
-
Abhinav almost 4 years
I am facing a weird issue. I am changing the text color of my button when it is highlighted but visually no change at all.
[myButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [myButton setTitleColor:[UIColor colorWithRed:150.0 green:150.0 blue:150.0 alpha:1.0] forState:UIControlStateHighlighted];
Am I missing something?