What about subclassing UIView and adding a UImage ivar (called image)? Then you can override -drawRect: something like this if you have a boolean ivar pressed that was set when touched.
- (void)drawRect:(CGRect)rect { [image drawAtPoint:(CGPointMake(0.0, 0.0))];
You would like to experiment with the RGBA values above. And, of course, non-rectangular shapes will require a bit more work - for example, CGMutablePathRef.
westsider
source share