禁用 iPhone 中 UIButton 的触摸动画

发布于 2024-11-16 13:09:10 字数 104 浏览 4 评论 0原文

我想禁用按钮按下或选择时的动画。我想模仿标签上发生选择的功能。与 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

烟花易冷人易散 2024-11-23 13:09:10

我认为您需要的是在 Interface Builder 中取消选择“突出显示调整图像”选项:
在此处输入图像描述

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

慕烟庭风 2024-11-23 13:09:10

2018 人,Swift 4.0:

设置按钮的 adjustsImageWhenHighlighted 属性有效。在我的自定义 UITabBarController 中需要这个(例如大的中心 tabBarItem)。

2018 people, Swift 4.0:

Setting the button's adjustsImageWhenHighlighted property worked. Need this in my custom UITabBarController (e.g. large center tabBarItem).

夏末的微笑 2024-11-23 13:09:10

禁用按钮的用户交互。

myButton.userInteractionEnabled = NO;

Disable the user interaction of your button.

myButton.userInteractionEnabled = NO;
嘿咻 2024-11-23 13:09:10

将按钮类型设置为自定义。

myButton.buttonType = UIButtonTypeCustom;

set your button type as custom.

myButton.buttonType = UIButtonTypeCustom;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文