ios - 手动设置 UIButton 状态

标签 ios objective-c iphone cocoa-touch uibutton

UIButton 使用 + buttonWithType:

我需要弄清楚的是如何手动更改按钮状态。有时我需要将其设置为“已禁用”。

我通读了 UIButton 文档,但似乎找不到任何关于手动设置按钮状态的信息。

如有任何想法,我们将不胜感激。

最佳答案

您尝试过 button.enabled = NO; 吗?

swift 5.0

button.isEnabled = false

关于ios - 手动设置 UIButton 状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/405134/

相关文章:

objective-c - 如何向 pod 中的 Objective C 类添加类别?

objective-c - Objective C 中的 C++ 模板替换

iphone - iPhone-尝试,捕获问题

ios - 如何检测iphone 4s

iPhone 6 设备以拉伸(stretch)模式显示应用程序

ios - SpriteKit SKLabelNode 对齐

ios - 流媒体服务器的主要作用是什么?

ios - 如何在 View 中切出具有径向渐变的孔

ios - 如何检测通知中心是否打开

iphone - UITextView 委托(delegate)方法 textView :shouldChangeTextInRange:replacementText: gives erroneous replacementText on fast delete