Im trying to troubleshoot my first iphone app and Ive run into a propblem i just dont get. I have lots of buttons on a view and when you click them their text colour changes from black to blue. I assume that I could fix this by just setting the textColor property every time the button gets pushed to set it back to black but I feel like there must be something else going on.
Anyone know why my buttons are changing color by themselves?
It is possible to have different title colors depending on button state. Set them using the following method of the UIButton class:
F.e.
where UIControlStateNormal is the default, not pressed, button state, and forState:UIControlStateHighlighted represents the pressed state. But there are more, and can be combined with binary sum, such as (UIControlStateHighlighted | UIControlStateSelected).