2012-03-10 41 views
0

我設計了一個應用程序來支持ios 4.3,並且從「支持的設備方向」我刪除了所有內容,只有肖像處於活動狀態。xcode 4.2.1 - 旋轉支持問題

問題是,當我在手機中模擬應用程序時,它支持所有的方向,我的應用程序看起來錯過了風景方向。

我該如何強迫它不支持風景方向?

回答

1

在您的視圖控制器調用

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

,迫使它不轉動在橫向模式。您還需要確保您的所有父視圖都有autoresizesSubviews = YES。

+0

(抱歉,犯了一個錯誤) – 2012-03-10 18:36:42