2014-01-08 42 views
0

enter image description here我的應用程序在肖像模式下正常啓動並且效果很好,但在我的應用程序中某些視圖僅支持橫向模式和一些橫向和肖像,當我切換應用程序視圖僅從景觀支持的一些觀點,即同時支持方向和旋轉設備,以肖像和點擊返回按鈕,景觀視圖不會自動旋轉Iphone肖像模式切換回風景模式不自動工作

我用下面的代碼來設置定向

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


- (BOOL)shouldAutorotate 
{ 
    return YES; 
} 




- (NSInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskLandscapeLeft; 
} 

謝謝

回答

2

編輯這些線

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

作爲

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    if (toInterfaceOrientation == UIInterfaceOrientationMaskLandscapeLeft) { 
     return YES; 
    } 
    else { 
     return NO; 
    } 
} 
相關問題