开发者

How to darken a custom UIButton

开发者 https://www.devze.com 2022-12-20 16:17 出处:网络
I\'ve subclassed the UIButton class and now a custom view will be drawn using quartz 2d. It all looks fine, but how can I darken the button at clicking it.

I've subclassed the UIButton class and now a custom view will be drawn using quartz 2d. It all looks fine, but how can I darken the button at clicking it. How can I set the views for the different states if I am using quartz in the same clas开发者_Python百科s to draw the button?

Thanks for your help


When a button is tapped, the setHighlighted: method gets called. If you overwrite it, you can do whatever you want upon tap (and release). Redraw or switch views.

0

精彩评论

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

关注公众号