【发布时间】:2011-08-08 13:49:37
【问题描述】:
在我的 iPhone 应用程序中,我有一个在 Interface Builder 中创建的 UIButton。我可以在我的代码中像这样成功地启用和禁用它...
sendButton.enabled = YES;
或
sendButton.enabled = NO;
但是,按钮的视觉外观始终相同!它不会褪色或变灰。如果我尝试单击它,它会按预期启用或禁用。我错过了什么吗?它不应该看起来褪色或变灰吗?
【问题讨论】:
-
你在 UIButton 中使用图像吗?
-
不,它没有,你需要设置它的 alpha,因此它会起作用。
标签: ios iphone cocoa-touch uibutton