IOS screen Rotation

Source: Internet
Author: User

IOS developers can achieve screen rotation in two ways;

1. LoadShouldautorotate andShouldautorotatetointerfaceorientation two methods, of course, there is a difference between ios6 and the previous version. For details, see "ios6 screen rotation details (automatic rotation, manual rotation, and systems compatible with ios6 )".Article.

The specific method is generally based on

The statusbarorientation method is used to determine the current landscape and landscape, and then set the View frame. In the rotation function that you overload, set the frame of the view based on the portrait screen again.

2. You can also customize a class for the view to be loaded. The layout of images and other resources in this view is all implemented in layoutsubviews. Add this view to vontroller and set

Autoresizingmask=
Uiviewautoresizingflexiblewidth|Uiviewautoresizingflexibleheight, use the bounds of the congtroller view to initialize the view (call initwithframe), and set the userinteractionenabled of the view.=No. In this way, other view response events in the Controller will not be blocked. In this way, the view is automatically rotated.

Related Article

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.