[英]IOS7 Xcode 5 universal app won't rotate on iphone, but will on ipad
[英]iOS Won't Rotate
我正在嘗試將自動旋轉添加到我的應用中,但是遇到困難。 我可以調整所有內容(一個TableView和幾個標簽),但是狀態欄和窗口的其余部分(例如,選項卡欄和導航控制器)仍然保持縱向。 我從窗口頂端的ViewController的三個視圖層次結構,我有一切shouldAutorotateToInterfaceOrientation
設置為YES,我也有,除了在選擇顛倒一切Summary
目標的屬性的部分,但它拒絕讓步。 這是在模擬器和iPhone 4上發生的。在XCode 4上都是4.3。我已經在視圖方向上搜索了蘋果文檔,但是還有其他地方需要設置嗎?
在我的Info.plist
,我具有以下內容:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
我最終發現,如果您有UITabBarController,則所有選項卡視圖都需要支持旋轉。 應該記住以下幾點,以節省一些時間:
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
方法中手動調整大小 在您的問題中,您聲明
我把一切都在
shouldAutorotateToInterfaceOrientation
設置為YES
但我不確定您的意思。 如果您支持所有方向,則只需返回YES
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
可能是您在此處所做的一切( 由於尚未發布代碼 )都無法按預期進行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.