segue from landscape only to portrait only

廉价感情. 提交于 2019-12-24 02:01:51

问题


I have two "pages" in my app. one which should rotate between the 2 landscape modes but not allow portrait mode and the other which should rotate between the 2 portrait modes but not allow landscape mode.

How can one set this up so that the orientations are limited correctly when segueing between the two views?


回答1:


I will write my own segue if I were you and set the orientation of the destination view in the perform method of your custom UIStoryboardSegue and will also set the orientation i want to allow in the shouldAutorotateToInterfaceOrientationof the destination view controller. You can have a look to this question related to custom segue I asked some time ago to get an idea of how to implement custom segue.



来源:https://stackoverflow.com/questions/13010655/segue-from-landscape-only-to-portrait-only

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!