UINavigationItem setHidesBackButton
- (void)setHidesBackButton:(BOOL)hidesBackButton animated:(BOOL)animated
Parameters of [UINavigationItem setHidesBackButton]
hidesBackButton
Specify YES if the back button should be hidden when this navigation item is the top item. Specify NO if the back button should be visible, assuming it has not been replaced by a custom item.
animated
YES to animate the transition; otherwise, NO.
UINavigationItem setHidesBackButton example.
in a controller use this:
[self.navigationItem setHidesBackButton:YES animated:YES];
And to restore it:
[self.navigationItem setHidesBackButton:NO animated:YES];
[self.navigationItem setHidesBackButton:YES animated:YES];
And to restore it:
[self.navigationItem setHidesBackButton:NO animated:YES];
Example of [UINavigationItem setHidesBackButton].
- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
if (editing) {
// Disable the back button
[self.navigationItem setHidesBackButton:YES animated:YES];
}
else {
// Enable the back button
[self.navigationItem setHidesBackButton:NO animated:YES];
}
[super setEditing:editing animated:animated];
}
{
if (editing) {
// Disable the back button
[self.navigationItem setHidesBackButton:YES animated:YES];
}
else {
// Enable the back button
[self.navigationItem setHidesBackButton:NO animated:YES];
}
[super setEditing:editing animated:animated];
}
UINavigationItem setHidesBackButton example.
-(void)viewDidAppear:(BOOL)animated
{
if ([tempAry count]==0)
{
[self.navigationItem setHidesBackButton:YES animated:YES];
}
else
{
[self.navigationItem setHidesBackButton:NO animated:YES];
}
[super viewDidAppear:animated];
}
{
if ([tempAry count]==0)
{
[self.navigationItem setHidesBackButton:YES animated:YES];
}
else
{
[self.navigationItem setHidesBackButton:NO animated:YES];
}
[super viewDidAppear:animated];
}