Strange placement of views within window (views seem to ignore status bar)

Discussion in 'iOS Programming' started by blueeye, Oct 20, 2009.

  1. blueeye macrumors member


    Oct 27, 2007
    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 :)
  2. blueeye thread starter macrumors member


    Oct 27, 2007
    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?
  3. JimBobBennett macrumors member

    May 4, 2009
    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.

Share This Page