Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

blueeye

macrumors member
Original poster
Oct 27, 2007
80
0
Hi all,

Whenever I've tried to create a "window based application" in Interface Builder I seem to get a weird displacement of the views within the window. They all seem to be shifted up by about 20px (actually the exact size of the status bar).
It seems that the window is ignoring the status bar when positioning the view or the view itself is ignoring the status bar.
I've tried playing with the alignment and status bar settings in Interface Builder but to no avail so I'm really a bit stumped.

Any ideas would be welcome :)
 

blueeye

macrumors member
Original poster
Oct 27, 2007
80
0
I fixed the problem but I'm not entirely sure that this is the right way of going about it.

In the MainWindow.xib file I created a UIViewController outlet (and made it a "MyViewController" instead). Within that I selected Resize View from Nib and selected the Nib name. I then connected that to the app delegate and hey presto, the view no longer has strange placement.
I don't really understand why, however.

Any ideas?
 

JimBobBennett

macrumors member
May 4, 2009
65
0
I got a similar thing with transparent status bars, views got adjusted as if the bar wasn't there. Changed to another type and all is good.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.