Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有两个viewcontroller,ViewControllerA支持横向和纵向,点击ViewControllerA中的一个按钮推入ViewControllerB,它只支持横向,然后我把手机变成横向然后弹回ViewControllerA,默认A现在是横向模式,但我希望它在这种情况下首先是肖像。我该如何实施?
在你ViewControllerA的viewwillappear方法中设置方向
ViewControllerA
viewwillappear
[[UIDevice currentDevice]setOrientation:UIInterfaceOrientationPortrait];