2011-08-22 59 views
0

我有一個非常標準的iPad應用程序,它只設置爲風景。要影響這一點,我已經設置了初始界面方向爲橫向,並支持接口的方向,只是單一的景觀離家按鍵,並且還覆蓋shouldAutorotateToInterfaceOrientation屬性如下:奇怪的iPad旋轉效果

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    BOOL b = UIInterfaceOrientationIsLandscape(interfaceOrientation); 
    return b; 
} 

真正奇怪的是,當應用程序啓動時,它是正確的,並且將iPad顛倒旋轉不會產生任何效果,但向下旋轉主屏幕會旋轉屏幕,但一旦旋轉,屏幕就不會再旋轉,因此認爲這不是旋轉設置。

有沒有人遇到過這個?

+0

你能在2個景觀取向之間旋轉它?你有沒有在Info.plist中設置支持的方向? – jtbandes

+0

只有上面的方向,它被設置爲只允許一個方向。 Info.plist中有一個單一的: UISupportedInterfaceOrientations〜ipad的 \t \t \t UIInterfaceOrientationLandscapeLeft \t \t UIInterfaceOrientation \t UIInterfaceOrientationLandscapeLeft

回答

1

從文檔:

#define UIInterfaceOrientationIsLandscape(orientation) \ 
    ((orientation) == UIInterfaceOrientationLandscapeLeft || \ 
    (orientation) == UIInterfaceOrientationLandscapeRight) 

所以,如果你想支持剛景觀旋轉之一,這是不是要走的路...