Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIButton flickers when pressed

Tags:

iphone

I have several UIButtons in my app with different graphics for their On/Off states. The smaller buttons all display correctly without any flickering, but the larger button (320x90px) will flicker a black color over the button when pressed up to 75% of the time. This is on the iPhone, not the Simulator. I've set different combinations of the UIButton's Default,Highlighted,Selected,and Disabled state images in IB but I still cannot get rid of this flicker. Is there something else I can try?

like image 772
Growth Mindset Avatar asked Nov 12 '09 22:11

Growth Mindset


1 Answers

If you are doing something like button.selected = !button.selected in your handler, then I had this problem as well. I fixed it calling button.highlighted = NO.

like image 145
ySgPjx Avatar answered Oct 26 '22 21:10

ySgPjx