ios7以后如何强制某个controller横屏 整个应用里,希望只有特定的一个controller横屏,其他都竖屏,怎么设置?有的说用原来的方法,审核会不通过的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 首先在这个viewContoller里面设定只支持横向//iOS 7 above-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation{ return UIInterfaceOrientationLandscapeLeft;}- (NSUInteger)supportedInterfaceOrientations{ return UIInterfaceOrientationMaskLandscape;} static int isFullScreen; // 1 == 全屏 3 == 竖屏if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) { SEL selector = NSSelectorFromString(@"setOrientation:"); NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]]; [invocation setSelector:selector]; [invocation setTarget:[UIDevice currentDevice]]; NSLog(@"-%d-",isFullScreen); [invocation setArgument:&isFullScreen atIndex:2]; [invocation invoke]; }项目设置只允许竖屏 想要在哪个控制器切换屏幕方向就复制我上面的代码 http://blog.csdn.net/u013068862/article/details/52911484这个可以用 有大神在PC端怎么获取IOS上的联系人,在非越狱的情况下 IOS调用webService函数获取数据的相关问题 请问我这代表哪里出了问题? xcode project navigator里面的路径错了怎么办? 企业版证书应用分发问题 ios仿微信录音 ios 如何向服务传数据 IOS读写XML文件,GDataXML无法加载 storyboard TableView reloadData 不刷新,盼指点 请问可以用Video toolbox 实现网络视频的转码吗? flv->mp4 多个微信安装 有没有获取IOS设备类型的函数
//iOS 7 above
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}- (NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscape;
}
SEL selector = NSSelectorFromString(@"setOrientation:");
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:[UIDevice currentDevice]];
NSLog(@"-%d-",isFullScreen);
[invocation setArgument:&isFullScreen atIndex:2];
[invocation invoke];
}项目设置只允许竖屏 想要在哪个控制器切换屏幕方向就复制我上面的代码
这个可以用