iOS开发之判断横竖屏
判断横屏 if ([UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeRight ||
[UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeLeft) { //当前横屏 } else { //当前竖屏 }
判断竖屏 if ([UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationPortrait || [UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationPortraitUpsideDown) { //当前竖屏 } else { //当前横屏 }