is it possible to update UIButton title/text programmatically?

后端 未结 12 1824
北海茫月
北海茫月 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:23

    Do you have the button specified as an IBOutlet in your view controller class, and is it connected properly as an outlet in Interface Builder (ctrl drag from new referencing outlet to file owner and select your UIButton object)? That's usually the problem I have when I see these symptoms.


    Edit: While it's not the case here, something like this can also happen if you set an attributed title to the button, then you try to change the title and not the attributed title.

提交回复
热议问题