Alex Rivera | Logout

Force iOS app to launch in landscape mode

Asked 2012-01-20T10:57:46.397
8

I am developing an app for iOS 5, which have to run in landscape mode. My problem is that I cannot get it to flip initially.

I have tried the adding "Initial interface orientation" set to "Landscape (right home button)" and adding the following method to my view controller:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

I can wrap my head around how it is supposed to work. (I found the code here)

I am also wondering how to use the "Supported Device Orientation" available in the Xcode 4.2 project setup, it does not seem to do anything.

I have been looking around the website and have not been able to find an example that solves my problem.

Thank you.

Edit
Report

2 Answers

0

i think if you at the supported interface orientations in the project plist it will work. just add a new line called "Supported interface orientations" and make it of array type and add 2 items for each of teh landsape views u want. havent tested this just a quick guess

answered 2012-01-20T11:04:47.877
-2

Try this this will help you, write this code in you viewdidload.

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
answered 2012-01-20T11:08:30.100

Your Answer