屏幕旋转--强转(可用)
来源:互联网 发布:vb中range对象 编辑:程序博客网 时间:2024/05/22 13:00
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)])
{NSNumber *num = [[NSNumber alloc] initWithInt:(m_bScreen?UIInterfaceOrientationLandscapeRight:UIInterfaceOrientationPortrait)];
[[UIDevice currentDevice] performSelector:@selector(setOrientation:) withObject:(id)num];
[UIViewController attemptRotationToDeviceOrientation];//这行代码是关键
}
SEL selector=NSSelectorFromString(@"setOrientation:");
NSInvocation *invocation =[NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:[UIDevice currentDevice]];
int val =m_bScreen?UIInterfaceOrientationLandscapeRight:UIInterfaceOrientationPortrait;
[invocation setArgument:&val atIndex:2];
[invocation invoke];
0 0
- 屏幕旋转--强转(可用)
- 屏幕强转实现
- IOS6屏幕旋转详解(自动旋转、手动旋转、兼容IOS6之前系统) 【转】
- 玩转iOS屏幕旋转
- IOS屏幕旋转(备忘)
- 旋转屏幕
- 屏幕旋转
- 屏幕旋转
- 屏幕旋转
- 旋转屏幕
- 屏幕旋转
- 屏幕旋转
- 屏幕旋转
- 屏幕旋转
- 屏幕旋转
- 旋转屏幕
- 屏幕旋转
- 屏幕旋转
- SpringMVC数据绑定全面示例
- liunx tomcat 重启
- java内存泄漏问题
- Java新技术---线程学习之常用同步工具类
- Java NIO使用及原理分析 (四)
- 屏幕旋转--强转(可用)
- 【hadoop】15、hive安装
- 每天进步一点点——linux——rpm
- 关于使用Zxing生成二维码的一些调整
- IOS App Icon Size 图标尺寸
- Xcode 6制作动态及静态Framework
- iOS代码编程规范
- 织梦dedecms|商品信息页标签
- Java NIO使用及原理分析 (一)