IPad orientation

In my info plist, I defined Supported Interface Orientations (iPad) as all orientations, and it works. The only problem is that if I start in landscape mode, it will start as a portrait, but if I turn and go back, it will be fixed. So how can I do this to take the launch orientation? THANKS.

+3
source share
3 answers

You can force orientation by doing the following in your own didFinishLaunchingWithOptions:or in the view controller viewWillAppear:.

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft animated:NO];
+6
source

UIViewController, [window addSubview:viewController.view];, shouldAutorotateToInterfaceOrientation YES .

iPad Portrait, , willRotateToInterfaceOrientation 0.

+1

I noticed that the orientation order of the interface from the main .plist files is also important. For example, http://monosnap.com/image/jJeImyVp6G3Mq1uXLSAVRA0te2VwgJ When starting, the application will be in landscape mode, and the home button will be on the right.

0
source

All Articles