Reputation: 1436
When an UIButton
is pressed, the normal situation is that it will be highlighted i.e. a shadow like layer will cover the image. Is there a way to prevent this from happening? Is there an attribute to handle this?
Upvotes: 6
Views: 4032
Reputation: 2368
You can also achieve this through Interface Builder. Uncheck "Highlighted Adjusts Image" in the Attributes inspector.
Upvotes: 4
Reputation: 3149
If you make a custom subclass of the UIButton you can override setHighlighted:(BOOL)highlighted to do nothing
- (void)setHighlighted:(BOOL)highlighted
{
return;
}
Upvotes: 5
Reputation: 15927
You normally don't press a button with Xcode, you use your finger (or mouse). But nitpicking aside: adjustsImageWhenHighlighted
set to NO
will do the trick.
Upvotes: 11