IOS screen automatically rotate the problem and the horizontal screen mode open APP problems

First configure the project to support the screen rotation

IOS screen automatically rotate the problem and the horizontal screen mode open APP problems

RootViewController is recommended for the case of UITabBarController to create a UITabBarController public parent class to achieve the following proxy method

IOS screen automatically rotate the problem and the horizontal screen mode open APP problems

Interpreted as follows:

PreferredInterfaceOrientationForPresentation I understand when opening the current interface to

ShouldAutorotate support rotation

SupportedInterfaceOrientations rotation direction supported by

Return returns the support for the currently selected Tabar

Put UINavigationController in tabbar also need to achieve the following in UINavigationController

IOS screen automatically rotate the problem and the horizontal screen mode open APP problems

The three method because my only need to screen the QLPreviewController interface so I just made a separate judgment if not specific interface can be as follows

IOS screen automatically rotate the problem and the horizontal screen mode open APP problems

Then if an interface wants to support the screen rotation only need to rewrite the writing method

IOS screen automatically rotate the problem and the horizontal screen mode open APP problems

To sum up the rotation of the tabbar in APP to support the rotation of the UINavigationController controlled by tabbar while the UINavigationController rotation is controlled by the value you set in the current Controller

If rootViewController is not UITabBarController then the same…

The two is in the mobile phone to cross screen mode to open the APP APP will follow the cross screen layout

Need to add the following method

– (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions{

[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait]; / / this method

….

}

This will solve the problem in the open screen mode to open the APP generated

(some two problems easily occur: when you load in the didFinishLaunchingWithOptions when another window several agents rotating screen also comply with in built its own window or cross screen mode to open the APP layout will still be chaos)

Please leave a message TUT