How to change UIbutton title once a UIbutton is pressed?

后端 未结 2 922
囚心锁ツ
囚心锁ツ 2021-01-25 10:56

I am having trouble changing the title of UIButton btn2 once btn1 is pressed. When I use _definition settitle:@\"Show Word\" forState: UIControlStateNormal it chan

相关标签:
2条回答
  • 2021-01-25 11:33

    u can try this way:

    [_definitionPressed setTitle:@"Normal State" forState:UIControlStateNormal];
    [_definitionPressed setTitle:@"Selected State" forState:UIControlStateHighlighted];
    
    0 讨论(0)
  • 2021-01-25 11:56

    Try something along the lines of:

    [btn2 setTitle:@"Show Word"]
    
    0 讨论(0)
提交回复
热议问题