Judgment iOS development of horizontal and vertical screen

Analyzing horizontal screen
 IF ([the UIApplication sharedApplication] == .statusBarOrientation UIDeviceOrientationLandscapeRight || 
[the UIApplication sharedApplication] == .statusBarOrientation UIDeviceOrientationLandscapeLeft) { // this landscape } the else { // this portrait }
Analyzing vertical screen
 IF ([the UIApplication sharedApplication] == .statusBarOrientation UIDeviceOrientationPortrait ||  
[the UIApplication sharedApplication] .statusBarOrientation == UIDeviceOrientationPortraitUpsideDown) {
     // this portrait 
} the else {
    // this landscape 
}

 

Guess you like

Origin www.cnblogs.com/hecanlin/p/11868489.html