Back button not showing on UINavigationController
I have 3 views. The first is a login, the second is a menu, and the third is the result of each part of the menu. I want that when the user logs in, the back button won't appear in the second view. This part works but when I go through the third view, it is hidden too. I've created a fourth view and when I enter, the back button appears and it lets me go back until the second view.
For hiding th开发者_StackOverflow中文版e back button, I've set this only in the second view:
- (void)viewDidLoad {
self.navigationItem.hidesBackButton = YES;
}
I've also tried to set the opposite in the third view and it don't show.
Why it is not showing on the third view?
do this in secondViewController(after the login one)
- (void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; self.navigationItem.hidesBackButton = NO; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.navigationItem.hidesBackButton = YES; }
精彩评论