大佬教程收集整理的这篇文章主要介绍了iphone – iOS 6中视图控制器的旋转错误,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
基本上,这是帮助我的信息:
我必须在中设置window.rootViewController = mainViewController
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
2.对于视图控制器在哪里
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
不只是返回YES,我不得不补充
- (NSUInteger)supportedInterfaceOrientations
返回相同的值
3.补充说
- (BOOL)shouldAutorotate { return YES; } - (NSUInteger)supportedInterfaceOrientations { return (UIInterfaceOrientationMaskPorTrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPorTraitUpsideDown); }
到mainViewController.m
4.补充说
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window { return (UIInterfaceOrientationMaskPorTrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPorTraitUpsideDown); }
到appDelegate.m(我相信这是可选的,用于设置默认值,以防它们未在应用程序的Info.plist文件中或在单个视图控制器中指定)
由于我希望我的代码向后兼容回3.0,我没有使用All orientation mask,因为我需要使用XCode 4.3进行编译
以上是大佬教程为你收集整理的iphone – iOS 6中视图控制器的旋转错误全部内容,希望文章能够帮你解决iphone – iOS 6中视图控制器的旋转错误所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。