2012-06-15 44 views
0

我們有一個iPad應用程序。它支持所有的界面方向。iPad設備方向//應用程序啓動時的界面方向

它完美,但下載後Xcode的, 的最後一個版本 - 當應用程序與didFinishLaunchingWithOptions 開始 - 或者Althought設備的方向是在橫向模式下執行事件applicationDidBecomeActive

接口變成永遠肖像模式。

它發生的只是第一次,在那之後,當我們旋轉設備或模擬器時,應用程序成功旋轉。

我在網上搜索,發現下一個解決方案: - 在app-info.plist上手動創建UISupportedInterfaceOrientations〜ipad節點幷包含四個支持的值。

<string>UIInterfaceOrientationLandscapeLeft</string> 
<string>UIInterfaceOrientationPortraitUpsideDown</string> 
<string>UIInterfaceOrientationPortrait</string> 
<string>UIInterfaceOrientationLandscapeRight</string> 

但仍然無法正常工作......

有什麼建議?

感謝,

伊萬

+0

如果我檢查設備取向是UIDeviceOrientationUnknown ... althought的 [[的UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; 先前已執行 –

回答

0

在Xcode中,選擇「導航器」面板中的「項目導航器」選項卡,並單擊應用程序的名稱在列表的最頂端。在主編輯區域,您應該看到左側的目標列表,選擇您的主要目標。在主編輯器的右側,轉到「摘要」,然後選擇「支持的設備方向」。

注意:我使用的是Xcode 4.3(至少在4.2中也是如此)。

+0

它已經完成..:S我正在使用Xcode 4.3.3。謝謝! –

0

添加這一行的appDelegate

[[UIApplication的sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];