IOS 方向开发
UIDeviceOrientation orientation;
orientation = [[UIDevice currentDevice] orientation];
switch (orientation) {
case UIDeviceOrientationFaceUp:
self.orientationLabel.text=@"Face Up";
break;
case UIDeviceOrientationFaceDown:
self.orientationLabel.text=@"Face Down";
break;
case UIDeviceOrientationPortrait:
self.orientationLabel.text=@"Standing Up";
break;
case UIDeviceOrientationPortraitUpsideDown:
self.orientationLabel.text=@"Upside Down";
break;
case UIDeviceOrientationLandscapeLeft:
self.orientationLabel.text=@"Left Side";
break;
case UIDeviceOrientationLandscapeRight:
self.orientationLabel.text=@"Right Side";
break;
default:
self.orientationLabel.text=@"Unknown";
break;
}
本文出自 “深圳市联城通科技公司” 博客,谢绝转载!
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。