In My Application,
I have Navigation Controller with root view controller.
To show/hide navigation bar which works fine.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
BOOL navbarhide=[self.navigationController.navigationBar isHidden];
[self.navigationController setNavigationBarHidden:!navbarhide animated:YES];
}
Works good but,
When navigation bar is hidden then view frame changes.
When navigation bar is not hidden then view frame changes.
Thanks in Advance…
Edit Setting set self.view.frame does not make any effect.
Best Answer
I have the same problem. In my project, it is because the view is scroll view. If your view is a scroll view or table view, you can try this:
I add below code to the controller.
Hope it can help you.