码迷,mamicode.com
首页 > 移动开发 > 详细

iOS开发之判断横竖屏

时间:2019-11-15 18:31:14      阅读:251      评论:0      收藏:0      [点我收藏+]

标签:device   ror   style   ati   nta   statusbar   uidevice   code   har   

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

 

iOS开发之判断横竖屏

标签:device   ror   style   ati   nta   statusbar   uidevice   code   har   

原文地址:https://www.cnblogs.com/hecanlin/p/11868489.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!