我有一個(簡單)網頁打包在phonegap應用程序中。如果我啓動應用程序,它會以橫向頁面寬度的縱向顯示頁面。所以文本從左下到左上開始。在右側,我有一個頁面應該結束的差距。Phonegap頁面有錯誤的旋轉,在橫向模式下顯示爲肖像
這是我所看到的:
支持的方向是橫向左右在我...-Info.plist
:
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationLandscapeRight</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
</array>
在我的iPad我鎖定屏幕旋轉。發佈圖像在橫向上顯示正確。
該頁面旨在適合具有固定尺寸的景觀。這是我的觀點:
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
並且該頁面具有正確的橫向寬度,但已轉向。我可以上下滾動。應用程序啓動後,ipad狀態欄從頂部向左跳轉。
UPDATE
我的目標設備更改爲僅允許和定向景觀只剩下現在的狀態欄上需要它是頂級的iPad。頁面仍然處於打開狀態...我也嘗試製作一個simple page version,它應該旋轉什麼也不起作用。
更新2
在Classes/MainViewController.m
我:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
什麼,當你旋轉你的應用程序爲縱向發生,然後再次景觀? – Krunal
檢查根控制器 - shouldAutorotateToInterfaceOrientation,如果它允許根視圖旋轉? – Tom
@Tom就是這樣!你能把它作爲答案發布嗎?所以我可以給你一些聲譽。非常感謝! – PiTheNumber