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

arnieterm

macrumors regular
Original poster
hi,

Does anybody know of a way to force landscape orientation for a view controller in an iPhone application?

I have defined a UI in Interface Builder that I want to always show in landscape mode.
When the app first starts though, it is always in Portrait Mode.

Once the orientation is changed to landscape it will never go back to Portrait since I have setup the shouldAutorotateToInterfaceOrientation method correctly, but I can't seem to figure out a way to start it out in landscape mode.
thanks in advance.

arnie
 
Open up your App Delegate M file.

Put This:

application.statusBarOrientation = UIInterfaceOrientationLandscapeRight;

Into the:

- (void)applicationDidFinishLaunching🙁UIApplication *)application {

Method.

If you want the statusbar on the other side, just change UIInterfaceOrientationLandscapeRight to UIInterfaceOrientationLandscapeLeft.

allbrokeup
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.