TabBar中的多个UISplitviewControllers并非全部通知轮换事件 [英] Mutltiple UISplitviewControllers in TabBar are not all notified of rotations events
问题描述
我有一个包含3个UISplitiViewControllers的tabBar的应用程序。除了一个场景之外,一切都很顺利:
I have an application with a tabBar containing 3 UISplitiViewControllers. Everything works well except for one scenario:
我在tab1上的ipad处于横向位置。我点击tab3,然后我旋转ipad肖像模式。我点击了tab1,它以肖像模式显示,我很高兴。
I have the ipad in landscape position on tab1. I click on tab3, then I rotate the ipad portrait mode. I click on tab1, it is well displayed in portrait mode, I'm happy.
我现在回到横向位置。
我再次点击tab3,然后,splitView控制器仍然以纵向模式显示。从未调用tab3中我的splitviewController的委托。
I click again on tab3 and there, the splitView controller is still displayed in "portrait mode". the delegate of my splitviewController in tab3 was never called.
有没有办法在viewWillAppear中强制旋转这个splitViewController?
Is there a way to force the rotation of this splitViewController in the "viewWillAppear"?
推荐答案
在对事件冒泡进行深入分析后,似乎旋转事件不会转发到隐藏的splitViews ...
如果不使用隐藏的api,就无法转发这些事件。
After a deep analysis of event bubbling, it appears that rotation events are not forwarded to hidden splitViews... There is no way to forward these events without using hidden apis.
很多开发人员遇到同样的问题,并且splitView中的事件管理实现已被报告为bug到苹果,即使指南只使用一个splitView添加到应用程序的根视图。
Lots a developers have the same problem and this implementation of event management in splitView has been reported as a bug to apple, even though guidelines are to use only one splitView added to the root view of application.
这篇关于TabBar中的多个UISplitviewControllers并非全部通知轮换事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!