如何获取当前屏幕状态,如横屏左横右横? 请问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设备方向 使用警告框实现登录功能 请问下有谁知道苹果视频怎么测,或者能提供一个方向 html5的网站怎么打包到ipad啊 iphone能否在程序中获得自己当前位置下的经纬度 两个 UIViewController切换 请教一个多场景传值问题 从textField跳转到textView中时,textView多了一行... 是输入流未清除的原因吗 怎么解决? 发布app遇到问题 代码签名的整个流程 umeng上的crash,获取文件路径 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
设备方向