In the past I've done the following:
thumbnailButton = [[UIButton alloc] initWithFrame: thumbnailButtonFrame];
[thumbnailButton addTarget:self action:@selector(thumbnailButtonPushed:) forControlEvents:UIControlEventTouchUpInside];
[thumbnailButton setBackgroundImage: thumbnailButtonImage forState: UIControlStateNormal];
[thumbnailButtonImage release];
Which has created a button that has a thumbnail image on it, and when pushed it sort of puts a grey highlight over it (much like the in the photos app when you're selecting a photo to display from the list of thumbnails).
I have a scenario now where I have a UIView
class that draws a graphic in it's drawRect
method. I'd like to put this UIView
on the UIButton
and have it highlight the same way if I add an image. I'd like to do this without subclassing UIButton
. Is this possible?