开发者

UIButton flickers when pressed

开发者 https://www.devze.com 2022-12-11 12:24 出处:网络
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 bl

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消