大佬教程收集整理的这篇文章主要介绍了iphone – 通用应用程序中的IOS 6方向问题,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if(UI_user_iNTERFACE_I@L_86_3@m() == UIUserInterfaceIdio@R_288_6165@) return UIInterfaceOrientationIsPorTrait(interfaceOrientation); return UIInterfaceOrientationIsLandscape(interfaceOrientation); }
在IOS 5中工作正常但在IOS 6中,自动旋转方法根本没有被解雇.之后我改变了方法,
-(BOOL)shouldAutorotate { return NO; } -(NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationMaskPorTrait; }
即使这种方法在IOS 6中也没有被解雇.
我的plist设置是
我需要同时处理IOS 5和IOS 6的方向[iPhone-porTrait,iPad-landscape].请指导我解决这个问题.
因此,在这些容器视图控制器上创建一个目标C类别并添加到您的项目中.
@implementation UINavigationController (autorotatE) -(NSUInteger)supportedInterfaceOrientations { //make the check for iphone/ipad here if(IPHONE) { return UIInterfaceOrientationMaskPorTrait; } else { return UIInterfaceOrientationMaskLandscape; } } - (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationPorTrait; } - (BOOL)shouldAutorotate { return NO; }
以上是大佬教程为你收集整理的iphone – 通用应用程序中的IOS 6方向问题全部内容,希望文章能够帮你解决iphone – 通用应用程序中的IOS 6方向问题所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。