About support for screen orientation in iOS

Source: Internet
Author: User

You can change its orientation to Landscape by setting the show Attrubite Inspector property of the View in the VC corresponding XIB, which will be the horizontal screen layout by default.
We can set the orientation of the app interface in 3 different ways.

First: Through Global settings
The system only calls this method if the application delegate have not
Implemented the delegate equivalent. It returns the orientations specified by
The application ' s info.plist. IF no supported interface orientations were
Specified it'll return Uiinterfaceorientationmaskall on an iPad and
Uiinterfaceorientationmaskallbutupsidedown on a phone. The return value
Should be one of the Uiinterfaceorientationmask values which indicates the
Orientations supported by this application.
-(Nsuinteger) Supportedinterfaceorientationsforwindow: (UIWindow *) window Ns_available_ios (6_0);

2nd, through the deployment info Device Orientation Select the orientation, of course, here and Plist file supported interface orientations corresponding to the same orientation, Change one place and another will change.

The 3rd kind, the single set VC to do the support orientation. Via function (after IOS 6.0)
-(BOOL) shouldautorotate{
return YES;
}

-(Nsuinteger) supportedinterfaceorientations{
return uiinterfaceorientationmasklandscape;
}
You can set the direction supported by the current VC.

The orientation supported by the final view is determined by the intersection of these 3. Note that the directions supported in the Plist file are executed according to the first item. (If supported)

Reference: Http://www.tuicool.com/articles/e2q6zi, Image: Horizontal screen layout. png

About support for screen orientation in iOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.