2012-10-05 62 views
1

當Xcode更新到v4.5時,我正在開發splitView項目。自那時以來,自動旋轉完美運行。更新之後,自動旋轉僅適用於iOS 6.在iOS 5.1上,我是以縱向方式堆疊的。我已閱讀所有可能的解決方案,但似乎無法解決我的問題。以下是我迄今爲止所做的:Xcode 4.5 SplitView與iOS 5.1分裂的方向(在iOS6上工作)

檢查所有方向都在我的plist中。 與

- (BOOL)shouldAutorotate 
{ 
    return TRUE; 
} 

- (NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskAll; 
} 

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation 
{ 
    return UIInterfaceOrientationLandscapeRight; 
} 

替換(BOOL)shouldAutorotateToInterfaceOrientation: 我添加以下代碼段中的應用程序委託

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

我展示的另一種回答下面的代碼片段我怎麼過的我不知道如何實現它的SPLITVIEW控制器

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

有人能幫助我嗎?

回答

2

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

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

繼續爲iOS 5,您的支持。因此,保持雙方爲iOS 6的新的和舊的iOS 5.注意,對於在iOS 5 全部旋轉的UISplitView必須具有上述方法。