背景:我想确保我的 viewController 在它出现时正确旋转。我的 viewController 具有出色的代码来管理可见时的旋转和方向。
问题:给定 NavigationController 中的两个 viewController,viewC1
并且viewC2
. 我做了以下事情:
1.) 将 rootViewController 设置为viewC1
2.) 推viewC2
入 NavigationController
3.) 旋转
4.) 流行音乐viewC2
5.)viewC1
仍然停留在旧方向外观(如未 willAnimateRotationToInterfaceOrientation
调用转换代码中)与新方向。
我能做些什么来确保viewC1
调用willAnimateRotationToInterfaceOrientation
重建自身以在新的轮换中正确显示?
附加信息:
这是所有代码(没有故事板/xib)。我对所有观点都有shouldAutorotateToInterfaceOrientation
回报。YES
我willAnimateRotationToInterfaceOrientation
用来管理我所有的轮换。
哦,请不要黑客。例如,从轮换中复制代码,然后手动检查轮换并在viewDidAppear
.