is it possible to update UIButton title/text programmatically?

后端 未结 12 1793
北海茫月
北海茫月 2020-12-07 19:58

I have a UIButton, that when pressed, brings up a new view where the user can change some settings. When the view is dismissed, I\'d like to update the title/t

12条回答
  •  情歌与酒
    2020-12-07 20:06

    I solved the problem just setting the title parameter for UIControlStateNormal, and it automatically works on the other states. The problem seems to be when you set another UIControlState.

    [myButton setTitle: @"myTitle" forState: UIControlStateNormal];
    

提交回复
热议问题