简体   繁体   中英

UIButton flickers when pressed

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?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM