Improve User Experience with Objective-C UIInterfaceOrientationLandscapeLeft

April 24, 2009 § Leave a comment

I’ve explained the benefits of going with landscape, tilted left on horizontal position.

Basically you have 2 choices

  • UIInterfaceOrientationLandscapeRight
  • UIInterfaceOrientationLandscapeLeft

How and where do we make it happen on Xcode project?

Best practices:
1. add UIInterfaceOrientation to info.plist
2. add – (BOOL)shouldAutorotateToInterfaceOrientation: method on your ViewController

In your info.plist, add a new line item manually
key: UIInterfaceOrientation
value: UIInterfaceOrientationLandscapeLeft

In your ViewController, add shouldAutorotateToInterfaceOrientation: method

– (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for Landscape OR Comment out entier method
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

This will keep the landscape orientation proper on simulator and device.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Improve User Experience with Objective-C UIInterfaceOrientationLandscapeLeft at Web Builders.

meta

%d bloggers like this: