This questions look repeated, but I din't got proper solution for my problem. In my case, Once I clicked back button I want to hide the navigation bar. For e.g. View1 pushed view2, view2 will have navigation bar,once I clicked back it brings me back to view 1 it should not contain navigation bar I need to hide it. I tried with viewWillDisappear method in view 2 to hide, it worked but if I have more view and I'm pushing each view from view1 if I click back button,navigation bar should hide in view1. So is anyway is there to know in view 1 itself that other view is popped. I tried viewwillappear method in view1 its not called. What can I do here.?
This method got called once I initially load view1, not after popping view2..
- (void) viewWillAppear : (BOOL)animated
{
[root_obj.navigationController setNavigationBarHidden:YES animated:YES];
}
This is how I am pushing view 2..
[root_obj.navigationController pushViewController:view2 animated:NO];
thanks in Advance
viewWillAppear
and seems to work just fine. Can you showviewWillAppear
code if possible? – iNoobNSLog
inviewWillAppear
, as far as i knowviewWillAppear
is always called when a view appears.-(void) viewWillAppear : (BOOL)animated { [root_obj.navigationController setNavigationBarHidden:YES animated:YES]; NSLog(@"VIEW WILL APPEAR!!"); [super viewWillAppear:animated]; }
, please give this code a go. – iNoob