禁用 iPhone 中 UIButton 的触摸动画
我想禁用按钮按下或选择时的动画。我想模仿标签上发生选择的功能。与 uilabel 相比,我对按钮的属性感到满意,因为我可以提供背景图像,它也可以帮助我解决更多问题。
请帮助我吗?
I want to disable the animation of button is touch down or selection. I want to mimic the feature that selection is happening on label. I am comfortable with the properties of button compare to uilabel because i can give my background image and it also help me in more issues.
Please help me in this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为您需要的是在 Interface Builder 中取消选择“突出显示调整图像”选项:

I think what you need is to unselect the "Highlighted adjusts image" option in Interface Builder:

2018 人,Swift 4.0:
设置按钮的
adjustsImageWhenHighlighted
属性有效。在我的自定义UITabBarController
中需要这个(例如大的中心 tabBarItem)。2018 people, Swift 4.0:
Setting the button's
adjustsImageWhenHighlighted
property worked. Need this in my customUITabBarController
(e.g. large center tabBarItem).禁用按钮的用户交互。
Disable the user interaction of your button.
将按钮类型设置为自定义。
set your button type as custom.