2

在我的iPhone應用程序中,我具有以下代碼以相對於設備方向旋轉視圖。視圖不是相對於設備方向旋轉,在我的iPhone應用程序中

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 

    return YES; 
} 

當設備旋轉到橫向模式時,視圖不旋轉。

我已經試過return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);

它沒有工作,我該怎麼辦呢?那類包含一個搜索欄,提前

+0

這樣enter image description here

感謝名單表視圖你在哪裏把你貼的代碼? – WolfLink

回答

3
I think the reason should be the below issue: 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 

    return YES; 
} 


"You should write return YES; in every viewController in your Application. Even in one class if you write return No; it will not work obviously..." 
+0

我已經試過這個,但仍然是視圖不旋轉 – Ravi

相關問題