我的应用程序使用 2 个 UIWindows。第一个显示有一个 TabBar 控制器,其 ViewControllers 只旋转到纵向方向。到这里一切都很好。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (UIInterfaceOrientationIsPortrait(interfaceOrientation));
}
在另一个窗口上,我有一个 UIViewController 可以旋转到所有方向。
问题是当我显示第二个窗口时
[secondWindow makeKeyAndVisible];
然后回到第一个
[firstWindow makeKeyAndVisible];
状态栏向所有方向旋转,并且不触发事件 shouldAutorotateToInterfaceOrientation。我该如何解决这个问题?