-->

的Xcode 4.5 SPLITVIEW破取向与iOS 5.1(在iOS6的工作思路)(Xcode

2019-08-01 04:54发布

我是在一个SPLITVIEW项目工作时,Xcode中已更新为V4.5。 从那时起自转是完美的工作。 更新后,自转仅适用于iOS 6在iOS 5.1中我我的肖像堆栈。 我已阅读所有可能的解决方案,但似乎没有什么能够解决我的问题。 下面是我迄今所做的:

检查了所有的方向都在我的plist。 更换(BOOL)shouldAutorotateToInterfaceOrientation:

- (BOOL)shouldAutorotate
{
    return TRUE;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeRight;
}

我添加以下代码段中的应用程序代理

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window
    {
        return (UIInterfaceOrientationMaskAll);
    }

我在另一个答案显示下面的代码片段我怎么过的我不知道如何实现它的SPLITVIEW控制器

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   ...
   window.rootViewController = topLevelViewController;
   ...
}

任何人可以帮助我这个?

Answer 1:

你需要保持的方法,从iOS 5中:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

继续为iOS 5,您的支持。因此,保持双方为iOS 6的新的和旧的iOS 5。注意,对于UISplitView到iOS 5中旋转所有封闭的视图控制器必须要有上面的方法。



文章来源: Xcode 4.5 SplitView broken orientation with iOS 5.1 (working on iOS6 thought)