Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 on edit I want to show save UIButton. when the content successfully saved I dont want to show save button any more.

I am a c# coder, in c# I used to do like this

C# code btnedit.visible=true; 

Now I want to know how to make a button visible and not visible from objective c code.

Thanks,

like image 812
nbojja Avatar asked Jun 05 '09 19:06

nbojja


People also ask

How do you hide a button in Objective C?

Instead of visible, the property you are looking for is hidden. saveButton. hidden = YES; That should do the trick.

What is a UIButton?

A control that executes your custom code in response to user interactions.


1 Answers

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

button.hidden = YES; 
like image 187
Benny Wong Avatar answered Oct 01 '22 21:10

Benny Wong