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

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 如何判断横竖屏,返回屏幕宽度)