When UIButton pressed UIButton normal situation is that it will be highlighted, i.e. a shadow layer will cover the image. Is there any way to prevent this? Is there an attribute for this?
UIButton
Usually you do not press a button using Xcode, you use your finger (or mouse). But disabling aside: adjustsImageWhenHighlighted set to NO will do the trick.
adjustsImageWhenHighlighted
NO
If you create a custom subclass of UIButton, you can override setHighlighted: (BOOL) allocated to not do anything
- (void)setHighlighted:(BOOL)highlighted { return; }
You can also achieve this through Interface Builder. Uncheck the "Select image substring" checkbox in the attribute inspector.