I am creating a toolbar in a Navigation Controller using the following code:
[self.navigationController setToolbarHidden:NO];
//Create a button
NSArray *toolbarItems = [NSArray arrayWithObjects:
[[UIBarButtonItem alloc] initWithTitle:@"Help" style:UIBarButtonItemStyleBordered target:self action:@selector(helpButton:)]
,nil];
The only problem is that the toolbar is visible whenever there is a navigation controller(multiple other views). Is there a way to only restrict the toolbar to a single view?
Thanks
To quote the UINavigationController Class Reference:
So, set a delegate for your navigation controller. In your delegate's
navigationController:willShowViewController:animated:
, do something like this:If you slightly modify the above example you can easily make it so the toolbar will automatically show when toolbar items are set in the current view controller's viewDidLoad method: