Questions tagged «uicontrolstate»

12
是否可以通过编程方式更新UIButton标题/文本?
我有一个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中指定的原始文本/标题。
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.