IOS determines the current screen rotation state

Source: Internet
Author: User

iOS provides a way to easily determine what state the current screen is rotated to


Uiinterfaceorientation sataus=[uiapplication sharedapplication].statusbarorientation;

Get the results there is a concentration situation where they are according to the current Home key in the phone's location


The resulting result is an enumeration type

Note that uiinterfaceorientationlandscapeleft are equal to Uideviceorientationlandscaperight (and vice versa).//This is Because rotating the device to the left requires rotating the content to the Right.typedef ns_enum (Nsinteger, Uiinterface Orientation) {    Uiinterfaceorientationunknown            = Uideviceorientationunknown,    Uiinterfaceorientationportrait           = uideviceorientationportrait,    uiinterfaceorientationportraitupsidedown = Uideviceorientationportraitupsidedown,    uiinterfaceorientationlandscapeleft      = Uideviceorientationlandscaperight,    uiinterfaceorientationlandscaperight     = Uideviceorientationlandscapeleft};


Uiinterfaceorientationportrait (Home key is below)



Uiinterfaceorientationportraitupsidedown(home key at top)


Uiinterfaceorientationlandscapeleft(Home key on the left side)


Uiinterfaceorientationlandscaperight(Home key on the right)





There's another kind of unknow that's probably not detectable.


All right.


Apple Development Group: 414319235 Welcome to join the Welcome discussion question


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

IOS determines the current screen rotation state

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.