Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching application in landscape orientation for IPad

Tags:

iphone

ipad

Facing one issue with launching application in landscape orientation for IPad. I have developed IPhone application which later I ported to IPad.

I have made setting regarding orientation in info.plist

[ UISupportedInterfaceOrientations~ipad ] to support all orientation UIInterfaceOrientationPortrait , UIInterfaceOrientationPortraitUpsideDown , UIInterfaceOrientationLandscapeLeft , UIInterfaceOrientationLandscapeRight.

but when I start IPad application in the landscape mode, it always start in the potrait mode.

Along this

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

{ return YES; }

help me, if I am missing something with this..

Thanks,

Sagar

like image 603
Sagar... Avatar asked Jun 01 '10 05:06

Sagar...


2 Answers

here's something I also discovered: setting the initial interface orientation in your info.plist is being ignored if you have Supported interface orientations set up with another orientation in the first slot! Put your initial orientation there as well - and the simulator will launch correctly, as will the app. this drove me nuts for a long time!

like image 151
jhhl Avatar answered Sep 28 '22 06:09

jhhl


Put UISupportedInterfaceOrientations into your -Info.plist, with a setting for each orientation you support. This is used to see which orientation the app can start in. From there onwards it will ask your view controllers.

like image 36
David Atkinson Avatar answered Sep 28 '22 05:09

David Atkinson