美文网首页
IOS 如何判断横竖屏,返回屏幕宽度

IOS 如何判断横竖屏,返回屏幕宽度

作者: 0诛仙0 | 来源:发表于2016-11-21 14:55 被阅读191次

NSInteger width = 0;

UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;

CGSize size = [UIScreen mainScreen].bounds.size;

if (UIInterfaceOrientationIsLandscape(orientation)) {

width = size.height;

} else {

width = size.width;

}

相关文章

网友评论

      本文标题:IOS 如何判断横竖屏,返回屏幕宽度

      本文链接:https://www.haomeiwen.com/subject/grtdpttx.html