Rotate to Portrait Orientation when back button pr

2019-06-10 02:13发布

Hey, I have an issue were I allow one viewcontroller to be displayed in portrait and landscape, however when the user hits the back button I want to switch the apps orientation back to portrait. At present if the user hits the back button when its in landscape mode the rest of the application stays in landscape mode, has anyone came across a solution for auto-rotating?

[EDIT]

The effect is similar to what occurs when use [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait]; but this is a hidden API method :-(

1条回答
放荡不羁爱自由
2楼-- · 2019-06-10 02:28

What I got from your question is you want to rotate only one view portrait and landscape. If that is what you want, then just go to method - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation

and then return true then your only that view will rotate.

查看更多
登录 后发表回答