开发者

How Can I Make a UIButton With No Animation Effects?

开发者 https://www.devze.com 2023-02-27 08:38 出处:网络
I know the title may be misleading so I\'m going to explain what I want to do here. I have a UIButton, a HUGE UIButton, set right after my application\'s background image. I configured the button to

I know the title may be misleading so I'm going to explain what I want to do here.

I have a UIButton, a HUGE UIButton, set right after my application's background image. I configured the button to show this image with a background image I set. When the user taps the button, it gets a huge gray shadow and I really don't want that. So how can I m开发者_高级运维ake a button that will maintain it's state no matter what the user tries to do with it? I really don't want it to change at all when the user interacts with it. In fact, I wanted to use an UIImageView instead just to avoid the button animation. Since I couldn't get taps out of the UIImageView, I decided to use a button, but no matter what I touch in IB, the button keeps getting that gray shadow, and I have configured the Selected State and other states to be exactly as my default state.


Figured it out.

glassBackground.adjustsImageWhenHighlighted = NO;

Ideally, I would have loved to do that with IB but I'm happy with this result.

0

精彩评论

暂无评论...
验证码 换一张
取 消