我寫了一個通用的應用程序,我在「shouldAutorotateToInterfaceOrientation」方法中返回YES。該方法正在調用,但每當我改變Iphone或Ipad的方向時,視圖不會旋轉。我甚至設置了autoresizesSubviewsshouldAutorotateToInterfaceOrientation not working in universal app
2
A
回答
5
這主要是因爲其他一些innerview不允許/設置方向更改。爲了清楚起見,當您旋轉設備時,將爲您的視圖樹上掛起的每個視圖控制器調用方法shouldAutorotateToInterfaceOrientation
。如果其中任何一個返回NO,則界面不會改變。例如,如果你有一個帶有viewcontrollers A,B,C和D的tabbarcontroller,那麼這個方法將被調用,所有這些方法都無關緊要,如果它現在正在顯示,那麼這個方法並不重要。
因此,請確保您已在所有視圖中對其進行了更改。
+0
謝謝......我還發現了另一個解決方案,即通過繼承UITabBarController。 – Sandy
+0
Owsam回答man.You岩石 –
相關問題
- 1. shouldAutorotateToInterfaceOrientation not working
- 2. UIViewController shouldAutorotateToInterfaceOrientation not working properly
- 3. LINQ「not in」not working
- 4. Wordpress WP_Query「NOT IN」not working
- 5. isset in php not working in angularjs
- 6. Map not working in 2.3
- 7. Emulator not working in Eclipse
- 8. jquery in wordpress not working
- 9. Button not working in layout
- 10. array.push in Javascript not working
- 11. removeClass not working in meteor.js
- 12. not working response.end()in Nodejs
- 13. position:fixed not working in chrome
- 14. PhotoKit:includeAllBurstAssets in PHFetchOptions not working
- 15. before_filter not working in state_machine :(
- 16. Bootstrap「collpase in」not working
- 17. Xpath in Javascript,not working?
- 18. obj_create not working in tastypie
- 19. file.copy in R not working
- 20. valueChanged in ListSelectionListener not working
- 21. Javascript div popup not not working in IE9 standard but but working in other modes
- 22. NgRoute is not working in jsfiddle
- 23. auth :: check in laravel 5 not working
- 24. position:fixed not working in Google Chrome
- 25. Preview not working in CDE plugin + pentaho
- 26. LIKE in SQL is not working
- 27. refs not working in react-native
- 28. mixins is not working in reactjs
- 29. Back Stack in fragments not working
- 30. Can not Canvas/CanvasLayer working in Playn
您使用的是什麼類型的應用程序?它是Tabbar還是Navigationbased?您在所有視圖控制器中指定返回YES? – Deeps