iOS开发中,代码如何判断 “竖排方向锁定” 是否开启? iOS开发中,代码如何判断 “竖排方向锁定” 是否开启? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试试把设备固定为竖屏if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { SEL selector = NSSelectorFromString(@"setOrientation:"); NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]]; [invocation setSelector:selector]; [invocation setTarget:[UIDevice currentDevice]]; int val = UIDeviceOrientationPortrait; [invocation setArgument:&val atIndex:2]; [invocation invoke]; } [UIViewController attemptRotationToDeviceOrientation]; 如果想自己控制的横竖屏的话看这里http://blog.csdn.net/codingfire/article/details/50387774完全自己掌握横竖屏 据说:当lock或者unlock时,-[UIViewController shouldRotateToInterfaceOrientation:] 都会被调用,你试试。 iphone开发中协议的使用 iphone有没有api可以自动配置vpn的ip/用户名/密码的信息,然后自动连接到该vpn的办法? iphone 中让线程沉睡的方法? 100分求解决UIWindow页面跳转问题!! ios UIButton一个奇怪的问题 二维码扫描软件 发布到Ipad上,线程报了个错:Tread 1:signal SIGABRT AFNetworking如何传一个对象 oc类别和扩展 给UIButton绑定点击事件无响应 IOS:FFmpeg可以将视频截成正方形,并且将60秒的视频截成10秒么 ios流媒体播放ts文件
if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
SEL selector = NSSelectorFromString(@"setOrientation:");
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:[UIDevice currentDevice]];
int val = UIDeviceOrientationPortrait;
[invocation setArgument:&val atIndex:2];
[invocation invoke];
}
[UIViewController attemptRotationToDeviceOrientation];