views:

322

answers:

1

I have a view xib that I'm manipulating through IB (for various reasons) and it will be launched as a modal view in code. I have a Toolbar at top and another one at bottom with some other UI elements in between. When I run the app, the placement of the top Toolbar isn't as I see it during the layout in IB.

In IB, the top Toolbar is placed at top below the status bar correctly and the next UI element (a label) appears below it. However, in the simulator, the top half of the Toolbar appears underneath the status bar and thus making it look cut off and there is a lot of space between the Toolbar and the label, which isn't reflected in the layout in IB.

For modal views, should the height of the view be different? If so, what does it need to be?

The view's height is set to default height value of 480.

A: 

Is the style of the status bar set to Translucent Black in IB? This causes the status bar to not consume any space and as a result "float" above the underlying Views.

MystikSpiral
ToolBar style is set to Default (and is blue)
Alexi Groove
How about the "View Size" window? What spans do you have enabled for auto-sizing? is the size and position set to the (0,0) plot at the top and left of the grid?
MystikSpiral
Alexi Groove
Make sure all four struts (the outer elements) are selected and red under "Autosizing". The struts fix the position of your sub-view on the superview.
MystikSpiral
Changing that doesn't seem to fix it. I can reproduce the same thing with the 'MoveMe' sample code from Apple and deselect the 'UIStatusBarHidden' option in the Info.plist. If no status bar is shown, everything looks right but when there's one, the Toolbar is under the status bar.
Alexi Groove
I wound up forgoing the use of Interface Builder and laid out view in code and this fixed it.
Alexi Groove