How can I hide a UIButton
on the tap of ano开发者_运维问答ther button, or any other event?
Create an outlet for the button to hide and connect it in your xib:
IBOutlet UIButton *myButton;
Now create an IBAction
for the other button and connect it in the xib:
-(IBAction)hideButton
{
myButton.hidden = YES;
}
So now when you click on the second button, it will hide myButton
.
In your IBAction
for the button tap:
[*yourbutton* setHidden:YES];
[self.btnReport setHidden:YES];
-(IBAction)hideButton
{
yourbutton.hidden = YES;
}
That should do it.
Do this in your other button's tap action:
yourButton.hidden = YES;
精彩评论