我在iPhone上開發一個簡單的遊戲。整個遊戲處於橫向模式,但記分牌頁面僅支持縱向模式。我在這裏檢查了問題,我只找到了轉向縱向模式,但我需要相反的答案。任何人都可以幫我嗎?iphone如何改變風景到人像?
1
A
回答
0
這很簡單。首先,確保目標摘要中支持縱向和橫向取向。然後:
在景觀ViewControllers,補充一點:
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;
}
而在縱向視圖控制器,補充一點:
-(NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
+0
非常感謝你! – Toygirl
0
我在AppDelegate中使用了這兩個調用。只獲取橫向比賽中心(比分板)。
// Supported orientations: Landscape. Customize it for your own needs
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_6_0
- (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
{
return UIInterfaceOrientationMaskAllButUpsideDown; //Getting error here? then update ur xcode to 4.5+
}
#endif
Xcode設置:標記橫向。
相關問題
- 1. Iphone風景和人像問題
- 2. jQuery Mobile-風景和人像變化
- 3. 如何限制更改爲風景Iphone?
- 4. iOS - Autolayout從風景到人像
- 5. ipad風景/人像圖片
- 6. 如何改變風景模式
- 7. 根據風景/人像更改UINavigationBar背景?
- 8. MPMoviePlayerController不會自動改變風景到風景
- 9. iPad - 根據設備方向(人像或風景)更改圖像
- 10. 響應式設計爲iphone風景和人像
- 11. 支持iPhone中的風景和人像的代碼
- 12. iphone pushviewcontroller風景
- 13. iphone UIKeyboard風景
- 14. 如何從肖像旋轉到風景?
- 15. Ghostscript改變了從風景到肖像的方向
- 16. 當從人像轉換到風景時,在iPhone和iPad上放大頁面
- 17. bootstrap中心圖像風景iphone
- 18. iphone強制肖像模式從風景?
- 19. iOS 6風景和人像取向
- 20. Android風景/人像不同的視口
- 21. 用PHP檢索風景/人像模式
- 22. 方向風景 - >人像不工作
- 23. Android AVD-Unabe旋轉風景/人像
- 24. 風景方向中的人像鍵盤
- 25. iPad Apps的風景和人像取向
- 26. iOS6中的人像和風景模式
- 27. iPhone風景問題
- 28. 如何知道設備/仿真器佈局(風景/人像)已更改
- 29. 如何在設備更改時立即檢測UIInterfaceOrientation方向(人像,風景)
- 30. iphone改變初始場景
這裏是同一個線程http://stackoverflow.com/questions/ 12577879/shouldautorotatetointerfaceorientation-is-not-working-in-ios-6/12581799#12581799 – Kamarshad