最佳答案
我有一个 UIButton
,当按下,带来了一个新的视图,用户可以改变一些设置。当视图被取消时,我想更新 UIButton
的标题/文本以反映新的状态。我打给你:
[myButton setTitle: @"myTitle" forState: UIControlStateNormal];
[myButton setTitle: @"myTitle" forState: UIControlStateApplication];
[myButton setTitle: @"myTitle" forState: UIControlStateHighlighted];
[myButton setTitle: @"myTitle" forState: UIControlStateReserved];
[myButton setTitle: @"myTitle" forState: UIControlStateSelected];
[myButton setTitle: @"myTitle" forState: UIControlStateDisabled];
但它似乎永远不会改变原来的文本/标题中指定的 IB。