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 t开发者_Go百科here an attribute to handle this?
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.
If you make a custom subclass of the UIButton you can override setHighlighted:(BOOL)highlighted to do nothing
- (void)setHighlighted:(BOOL)highlighted
{ 
    return;
}
You can also achieve this through Interface Builder. Uncheck "Highlighted Adjusts Image" in the Attributes inspector.

 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论