interface building landscape question
Senior Member
[Original Poster]
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
interface building landscape question
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

how do I change that?
Senior Member
Joined: May 2009
Location: Palmerston North, New Zealand
Posts: 464
Quote:
Originally Posted by
wootbean
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

how do I change that?
There's a little arrow in the top right corner of the view window, give that a whirl
Senior Member
[Original Poster]
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
Quote:
Originally Posted by
PixelthisMike
There's a little arrow in the top right corner of the view window, give that a whirl



Thank you
Senior Member
[Original Poster]
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
aah now I have another problem:
in interface builder my window looks like this
but in the simulator it gets messed up:
how do you fix this?
Senior Member
Joined: May 2009
Location: Palmerston North, New Zealand
Posts: 464
Have you changed the "Initial interface orientation" in your plist file? Hopefully that should do it, orientations always confuse me
Senior Member
[Original Poster]
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
Quote:
Originally Posted by
PixelthisMike
Have you changed the "Initial interface orientation" in your plist file? Hopefully that should do it, orientations always confuse me

I made it Landscape (right home button I think)
Developer
Joined: Mar 2009
Location: Singapore
Posts: 1,770
Remove the info.plist initial interface orientation and do it in code instead, it always works for me.
Senior Member
[Original Poster]
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
Quote:
Originally Posted by
froggy1233
Remove the info.plist initial interface orientation and do it in code instead, it always works for me.

nothing changed

Is this the right code?
[application setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:YES];
Senior Member
Joined: May 2009
Location: Palmerston North, New Zealand
Posts: 464
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