开发者

iPad startup orientation

In my info plist, I have defined Supported interface orientations (iPad) as all orientations, and it works. The only problem is if I start in landscape mode, it starts as portrait, but If I rotate and then rotate back, it fixes. So how c开发者_如何学Can I make it so it adopts to the startup orientation? thANKS.


You can force the orientation you need by implementing the following in either your didFinishLaunchingWithOptions: or in a view controller's viewWillAppear:.

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];


The UIViewController that is installed as the root controller via [window addSubview:viewController.view]; should implement the shouldAutorotateToInterfaceOrientation function and return YES to all supported orientations.

The iPad starts the views with Portrait orientation and then rotates all the views by calling willRotateToInterfaceOrientation function with a duration of 0.


I noticed that the order of the interface orientations from the main .plist files is important also. E.g http://monosnap.com/image/jJeImyVp6G3Mq1uXLSAVRA0te2VwgJ Means that at startup the app will be in landscape, with the home button on the right.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜