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 :-(

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top