Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Mobile Products: iPhone, iPad, iPod
iOS and Apps
Remove button from navigation bar of all screens and show it to only one screen.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="prateek.chaubey" data-source="post: 1310297" data-attributes="member: 192954"><p>In my app for iPad, I have first a welcome screen then home screen and then home screen navigates to rest of the screens. I have made a button on navigation bar of the home screen which takes the user back to the welcome screen. But that button is shown on all other screens as well. I want to remove that button from all the screens and show it only in the home screen. How can I hide that button from all other screens and make it visible only on the home screen?</p><p></p><p>Here is the code which I wrote for that button in viewDidLoad of Home:</p><p></p><p>[PHP]CGRect frame4 = CGRectMake(10.0, 0.0, 40.0, 40.0);</p><p>UIImage *buttonImage4 = [UIImage imageNamed:@"InfoIcon.png"];</p><p>UIButton *InfoButton = [UIButton buttonWithType:UIButtonTypeCustom];</p><p>InfoButton.frame = frame4;</p><p>[InfoButton setBackgroundImage:buttonImage4 forState:UIControlStateNormal];</p><p>InfoButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;</p><p>InfoButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;</p><p>[InfoButton addTarget:self action:@selector(info) forControlEvents:UIControlEventTouchUpInside];</p><p>[InfoButton setBackgroundColor:[UIColor clearColor]];</p><p>[self.navigationController.navigationBar addSubview:InfoButton];[/PHP]</p><p></p><p>Thanks</p><p>PC</p></blockquote><p></p>
[QUOTE="prateek.chaubey, post: 1310297, member: 192954"] In my app for iPad, I have first a welcome screen then home screen and then home screen navigates to rest of the screens. I have made a button on navigation bar of the home screen which takes the user back to the welcome screen. But that button is shown on all other screens as well. I want to remove that button from all the screens and show it only in the home screen. How can I hide that button from all other screens and make it visible only on the home screen? Here is the code which I wrote for that button in viewDidLoad of Home: [PHP]CGRect frame4 = CGRectMake(10.0, 0.0, 40.0, 40.0); UIImage *buttonImage4 = [UIImage imageNamed:@"InfoIcon.png"]; UIButton *InfoButton = [UIButton buttonWithType:UIButtonTypeCustom]; InfoButton.frame = frame4; [InfoButton setBackgroundImage:buttonImage4 forState:UIControlStateNormal]; InfoButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; InfoButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; [InfoButton addTarget:self action:@selector(info) forControlEvents:UIControlEventTouchUpInside]; [InfoButton setBackgroundColor:[UIColor clearColor]]; [self.navigationController.navigationBar addSubview:InfoButton];[/PHP] Thanks PC [/QUOTE]
Verification
Post reply
Forums
Apple Mobile Products: iPhone, iPad, iPod
iOS and Apps
Remove button from navigation bar of all screens and show it to only one screen.
Top