Step1. Select the direction of application support under project targets. In the application, you need to select the device direction you want to use.
Step2. If the Viewcontroller in your app does not support all the directions selected in Step1, you need to override the two methods of the base class
-(BOOL) shouldautorotate
{
return NO;
}
-(nsuinteger) supportedinterfaceorientations
{
// return to the current viewcontroller supported screen orientation, select the value you need
return uiinterfaceorientationmaskportrait; // only support Home key in the direction below
//Return uiinterfaceorientationmasklandscape;//support two-way horizontal screen
}
Note: If the current Viewcontroller is in a Navigationcontroller sub-controller, the method does not work and needs to be overridden in the Navigationcontroller method.
This article from "Xuan de yuan green" blog, please be sure to keep this source http://10264770.blog.51cto.com/10254770/1672156
Only a few pages in the app under IOS 8 require a horizontal screen with the rest of the vertical screen.