【问题标题】:How do I find what to refer to a UIButton as? [closed]如何找到将 UIButton 称为什么? [关闭]
【发布时间】:2013-02-09 14:46:12
【问题描述】:

一旦UISwitchOFF 移动到ON,我想要一个特定的UIButton 改变颜色。我要输入什么

- (IBAction) Court1ON {
//here
}

要在我的故事板中引用特定的UIButton

【问题讨论】:

  • 什么IBOutlet 实例变量连接到 nib 文件中的控件。

标签: ios objective-c xcode ipad uibutton


【解决方案1】:

你有几种可能做到这一点:

  1. 为情节提要中的按钮分配tag;然后通过以下方式访问按钮:

    [self.view.viewByTag:buttonTag];
    
  2. 创建UIButton 类型的IBOutlet @property 并将其绑定到您的按钮。

【讨论】:

  • 非常感谢,现在整理好了。
猜你喜欢
  • 1970-01-01
  • 2013-10-21
  • 1970-01-01
  • 2010-09-19
  • 2017-12-23
  • 1970-01-01
  • 1970-01-01
  • 2011-01-20
  • 2016-03-10
相关资源
最近更新 更多