如何获取当前屏幕状态,如横屏左横右横? 请问Object-C如何获取当前屏幕的状态?我需要捕获屏幕到底是横屏还是竖屏,还要分左横,右横多谢~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); }UIInterfaceOrientationPortrait 是一个枚举值,有四个状态值!你可以去查下 通过获取电池条的方向来判断设备方向uidevice currentdevice 的orientation就可以读出设备方向还可以计算设备的角度http://blog.csdn.net/ArthurChenJS/archive/2011/04/24/6358511.aspx 是的,UIApplication和UIDevice中可以获取到 以下这段代码可以用来判断 iPhone 屏幕的朝向 @interface UIViewController (UIViewControllerRotation)@property(nonatomic,readonly) UIInterfaceOrientation interfaceOrientation;当前UIViewController的方向UIKIT_EXTERN_CLASS @interface UIDevice : NSObject @property(nonatomic,readonly) UIDeviceOrientation orientation; // return current device orientation设备方向 调用地图路径规划服务提示000002 调用服务发生异常 求助ios 5上使用system调用shell语句 求助:如何接收推送信息? [新手]一个内存问题 求解决发布iPhone应用文件大的问题 关于不能socket不能和服务器通讯问题 ios有没有自动打包的办法 iphone分辨率终极指南(含iphone6/6+) 请问下IOS怎样监听屏幕解锁 微信中是否能用通用链接直接唤起第三方app iphone的文本编辑器是用什么做的 关于iTunesMobileDevice接口问题
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}UIInterfaceOrientationPortrait 是一个枚举值,有四个状态值!你可以去查下
uidevice currentdevice 的orientation就可以读出设备方向
还可以计算设备的角度
http://blog.csdn.net/ArthurChenJS/archive/2011/04/24/6358511.aspx
@property(nonatomic,readonly) UIInterfaceOrientation interfaceOrientation;
当前UIViewController的方向UIKIT_EXTERN_CLASS @interface UIDevice : NSObject
@property(nonatomic,readonly) UIDeviceOrientation orientation; // return current device orientation
设备方向