★ TouchArcade needs your help. Click here to support us on Patreon.

interface building landscape question

11-09-2009, 09:27 PM
#1
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?
11-09-2009, 09:37 PM
#2
Joined: May 2009
Location: Palmerston North, New Zealand
Posts: 464
Quote:
Originally Posted by wootbean View Post
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

Check out Sheepish, 100+ levels of puzzle fun! With sheep!
And more about us: www.pixelthismobile.com
plus+ id: Newtz

11-09-2009, 10:27 PM
#3
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
Quote:
Originally Posted by PixelthisMike View Post
There's a little arrow in the top right corner of the view window, give that a whirl


Thank you
11-09-2009, 10:45 PM
#4
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?
11-09-2009, 10:47 PM
#5
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

Check out Sheepish, 100+ levels of puzzle fun! With sheep!
And more about us: www.pixelthismobile.com
plus+ id: Newtz
11-09-2009, 11:31 PM
#6
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
Quote:
Originally Posted by PixelthisMike View Post
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)
11-09-2009, 11:34 PM
#7
Joined: Mar 2009
Location: Singapore
Posts: 1,770
Send a message via AIM to kohjingyu
Remove the info.plist initial interface orientation and do it in code instead, it always works for me.
11-10-2009, 04:38 PM
#8
Joined: Feb 2009
Location: the next whiskey bar
Posts: 5,549
Quote:
Originally Posted by froggy1233 View Post
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];
11-10-2009, 07:36 PM
#9
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

Check out Sheepish, 100+ levels of puzzle fun! With sheep!
And more about us: www.pixelthismobile.com
plus+ id: Newtz