How to stop view resizing after unhiding the NavigationBar
I have a view with a UITabBar
and the navigation bar is initially hidden. When I press the next tab I want the nav bar to be shown, but when I do this using setNavigat开发者_如何学CionBarHidden:
the view gets resized, and the tabbar is pushed out of the screen. How do I setup the views to where they won't get resized? Or get resized properly?
You will have to check your autoresizingMask
s. You can adjust them programmatically or via IB. Autosizing
is available in the Size Inspector
on the right.
You will mostly have to change the tab bar's mask to fix it to bottom and left. Rest of the subviews will have to be handled as needed.
[self.navigationController setNavigationBarHidden:NO animated:NO];
or after that
set urview frame to exactly for 44reduce(which is navingation bar height) from height.
精彩评论