在iPhone上将方向设置为纵向

109*_*793 1 iphone xcode rotation screen-orientation autorotate

我有一个应用程序,包括一个登录,3个表,然后一个图像.

您可以将图像旋转到横向模式,但我想要做的是当按下"后退"按钮并且应用程序返回到上一个屏幕时,我是应用程序自动旋转以提供纵向视图.

有没有办法做到这一点?

iut*_*nvg 5

对于以前的控制器

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
if (UIInterfaceOrientationIsPortrait(toInterfaceOrientation)) {
    return YES;
}
return NO;}
Run Code Online (Sandbox Code Playgroud)