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