Show or Hide a UIButton in iPhone app with Objective-C

后端 未结 4 538
半阙折子戏
半阙折子戏 2021-02-05 01:23

I am using UITextView to edit text. I want to use two UIButtons Edit and Save. Initially I want to show edit UIButton, when the user click

相关标签:
4条回答
  • 2021-02-05 02:04

    Instead of visible, the property you are looking for is hidden.

    saveButton.hidden = YES;
    

    That should do the trick.

    0 讨论(0)
  • 2021-02-05 02:12

    Simply Add IBoutlet property in .h file. like

    @property (strong, nonatomic) IBOutlet UIButton *resendOtpButtom;
    

    then add

    _resendOtpButtom.hidden = YES; in .m file. 
    
    0 讨论(0)
  • 2021-02-05 02:21

    Consider enabling or disabling the buttons instead. You get the same end result, but it's a little bit more consistent since things aren't appearing and dissapearing out of nowhere.

    0 讨论(0)
  • 2021-02-05 02:28

    Since UIButton inherits from UIView, you can just set the hidden property on the button (via UIButton doc)

    button.hidden = YES;
    
    0 讨论(0)
提交回复
热议问题