This is a discussion on Hiding a UIButton Programmatically within the iPhone/iPad Programming Tutorials forums, part of the Programming Section category; Hello, Here is a tutorial to show how to hide a UIButton programmatically: 1) Create a Button from Interface Builder ...
Hello,
Here is a tutorial to show how to hide a UIButton programmatically:
1) Create a Button from Interface Builder
2) Create and connect an IBOutlet at your .h file:
Code:IBOutlet UIButton *sample; @property (nonatomic, retain) IBOutlet UIButton *sample;
3) at your implementation file, synthesize the UIButton:
4) Put the following code inside any method in your implementation depending on when you want the button to hide, i'll use a conditional to check if there is a camera on iOS device or not:Code:@synthesize sample;
If you have any questions don't hesitate to askCode:if ( ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])) { sample.hidden = YES; }![]()
MozyMac Founder,Chairman and CEO
MacBook Pro Unibody late 2008 2.4Ghz 4GB ram 250GB HD
MozyMac Youtube Channel