问题
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 shouldAutorotateToInterfaceOrientation
of 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