Changing UIButton text

后端 未结 7 1383
遇见更好的自我
遇见更好的自我 2020-12-25 10:23

So I\'m trying to update the text on a UIButton when I click it. I\'m using the following line to change the text:

calibrationButton.titleLabel.text = @\"Cal         


        
相关标签:
7条回答
  • 2020-12-25 11:16

    Not a huge deal, and possibly obvious, but there are several states available for buttons. If you provide the 'wrong' one, you will not see the text change as desired.

    I noticed that my button was not showing the text I added, using the methods shown here. Check this link to make sure you are providing the UIControlState that you intend.

    What's the difference between UIControlStateHighlighted and UIControlStateSelected?

    0 讨论(0)
提交回复
热议问题