tags:

views:

22

answers:

2

Trying to figure out why my view is being pushed up into the nav controller. From, the documentation...

"The view is automatically resized to fit between the navigation bar and toolbar (if present) before it is displayed."

In my case it is not. The view doesn't seem to take into account the fact a nav bar is there.

Any ideas?

MultiSalesViewController *childController;

childController = [[MultiSalesViewController alloc] initWithNibName:@"MultiSalesView" bundle:nil];

[self.navigationController pushViewController:childController animated:NO];
A: 

My guess would be that your autoresize masks are not set properly in Interface Builder. Double check them inside IB on the inspector.

logancautrell
I played around with it and it didn't seem to have any effect. What settings would you expect?
butchcowboy
turns out....translucent nav bars are the culprit. from the docs.... "Regardless of the value of this property, navigation controllers always allow views to overlap translucent navigation bars.". Now I switched them to black and life is good.
butchcowboy
If you are using the translucent setting, then you have to account for that in your view size. You could continue to use the translucent setting, just add the appropriate padding to your view. Note that if you support both orientations, that the bar size changes.
logancautrell
A: 

If it's "covering" the nav bar completely, it's likely that you're either setting the navigationBarHidden to YES or calling setNavigationBarHidden:animated: somewhere. Most like in viewDidLoad or viewDidAppear or viewWillAppear in MultiSalesViewController.

It may be possible to set this in Interface Builder as well, but I couldn't find anything obvious.

Robot K