我想在視圖的顯示方向上更改視圖的方向。
例如:
無論何時用戶單擊按鈕,都會向用戶顯示新視圖。無論什麼方向,我都希望在橫向模式下顯示此視圖。
任何想法.....更改iPhone中視圖的方向
0
A
回答
2
添加此功能在新視圖中將方向更改爲橫向模式。
- (BOOL)shouldAutorotateToInterfaceOrientationUIIn terfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
0
添加到您的視圖控制器
- (BOOL)shouldAutorotateToInterfaceOrientationUIIn terfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
2
使用此功能,在您的類。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight ||
interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
相關問題
- 1. 縮放iPhone的方向更改視圖
- 2. Iphone方向更改
- 3. 如何更改視圖的特定部分的方向iPhone
- 4. 更改視圖iphone
- 5. 以不同的方向更改視圖
- 6. iPhone - UIView方向更改
- 7. Iphone:手動更改方向
- 8. 在iPhone/iPad中更改UIImage的方向
- 9. Android - 添加視圖方向更改
- 10. 以方向更改視圖佈局
- 11. 更改方向更改時的視圖大小
- 12. 如何更改方向更改時的視圖佈局?
- 13. IPHONE:在App Delegate中刪除/添加子視圖後,方向更改失敗
- 14. 瞭解座標,視圖,子視圖和方向更改
- 15. iPhone:道路方向地圖視圖
- 16. iPhone視圖顯示錯誤的方向
- 17. 容器視圖控制器中的力方向更改
- 18. 更改列表視圖sort XAML中的屬性/方向僅限
- 19. 使用Swift更改子類中方向更改的自定義視圖框架
- 20. iphone中的地圖方向
- 21. 以編程方式添加保存方向更改的視圖?
- 22. 改變iphone方向
- 23. 更改或禁用iPhone旋轉動畫時的方向更改
- 24. 如何更改AVPlayer的視頻方向?
- 25. 在iPhone OS 3.0上改變方向時管理子視圖
- 26. iPad:改變加載方向的視圖
- 27. 手動更改相機視圖頂部的視圖的鍵盤方向
- 28. 如何更改特定視圖的視圖控制器的方向
- 29. 如何根據滾動視圖方向更改圖像(Android)
- 30. iphone如何更改視圖控制器
它仍然只顯示縱向模式下的視圖。當手機傾斜時,它會切換到橫向模式。但是我想在加載視圖時將其更改爲橫向模式;) – SNR 2011-02-28 09:39:52