views:

247

answers:

1

Hello!

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

+1  A: 

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.

Jongsma