Question

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 class to draw the button?

Thanks for your help

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top