interface building landscape question

Discussion in 'Public Game Developers Forum' started by wootbean, Nov 10, 2009.

  1. wootbean

    wootbean Well-Known Member

    Feb 8, 2009
    5,549
    1
    36
    the next whiskey bar
    Hi I have another possibly stupid question but I can't figure it out...I made a simple app I wrote launch in landscape, but when I open the MainWindow.xib file with interface builder it always shows up in portrait :confused: how do I change that?
     
  2. PixelthisMike

    PixelthisMike Well-Known Member

    There's a little arrow in the top right corner of the view window, give that a whirl :)
     
  3. wootbean

    wootbean Well-Known Member

    Feb 8, 2009
    5,549
    1
    36
    the next whiskey bar
    :rolleyes::rolleyes::rolleyes:

    Thank you :)
     
  4. wootbean

    wootbean Well-Known Member

    Feb 8, 2009
    5,549
    1
    36
    the next whiskey bar
    aah now I have another problem:
    in interface builder my window looks like this
    [​IMG]

    but in the simulator it gets messed up:
    [​IMG]

    how do you fix this? :eek:
     
  5. PixelthisMike

    PixelthisMike Well-Known Member

    Have you changed the "Initial interface orientation" in your plist file? Hopefully that should do it, orientations always confuse me :p
     
  6. wootbean

    wootbean Well-Known Member

    Feb 8, 2009
    5,549
    1
    36
    the next whiskey bar
    I made it Landscape (right home button I think)
     
  7. kohjingyu

    kohjingyu Well-Known Member

    Mar 20, 2009
    1,770
    0
    0
    Student/Developer
    Singapore
    Remove the info.plist initial interface orientation and do it in code instead, it always works for me. :)
     
  8. wootbean

    wootbean Well-Known Member

    Feb 8, 2009
    5,549
    1
    36
    the next whiskey bar
    nothing changed :(
    Is this the right code?

    [application setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:YES];
     
  9. PixelthisMike

    PixelthisMike Well-Known Member

    Try putting the following in your highest level view controller:

    Code:
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    }
    For example I created a test prject called LandscapeTest. I made the change to the plist file, turned the nib view to landscape and added a nav bar and toolbar. Then I added the above code to LandscapeTestViewController.m.

    Make sense? Works for me :)
     

Share This Page