change text of button and disable button in iOS

后端 未结 8 893
Happy的楠姐
Happy的楠姐 2020-12-23 12:52

How do you change the text of the button and disable a button in iOS?

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-23 13:45

    To Change Button title:

    [mybtn setTitle:@"My Button" forState:UIControlStateNormal];
    [mybtn setTitleColor:[UIColor blueColor] forState:UIControlStateNormal];
    

    For Disable:

    [mybtn setEnabled:NO];
    

提交回复
热议问题