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.
精彩评论