when first entry, the result like this
App into the background and back, the orientation is normal
这是ViewController的代码:
DDYLoveAutoHallViewController *autoHallViewController = [[DDYLoveAutoHallViewController alloc] initWithEvent:room.currentEventID type:AHRoom_System];
[self presentViewController:autoHallViewController animated:YES completion:nil];
不知道为什么,这个项目有点老了,以前支持iOS5。
最佳答案
在不了解你如何管理布局的情况下,很难给出确切的原因,导致你的问题,但是,我可以给你一些小建议:
尝试重新检查 - (void)viewDidLayoutSubviews 中的方向,您可以从那里重新定位。 (可能它会工作并解决你的问题,但它不是很干净的解决方案,因为有时可能会被调用几次,知道这一点你可以使它更干净)
通常使用布局生命周期的方法来检测哪里出了问题。深入了解 iOS 上的现代布局方式。 (更好的解决方案)
关于ios 横向屏幕纵向结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41595049/