是否可以只旋转一个子 vc?
xamarin 代码(与 swift 几乎相同)
mainVC.addChildViewController(childVC_A);
mainVC.addChildViewController(childVC_B);
mainVC.addSubView(childVC_A.View);
mainVC.addSubView(childVC_B.View);
mainVC
的 shouldAutorotate
为 true,并且 GetSupportedInterfaceOrientations
返回所有方向;
我只希望 childVC_A
自动旋转到横向模式,而 childVC_B
始终保持纵向模式。
childVC_A
的 shouldAutorotate
为 true
且 GetSupportedInterfaceOrientations
返回所有方向;
childVC_B
的 shouldAutorotate
为 false
且 GetSupportedInterfaceOrientations
仅返回纵向;
这可能吗?
最佳答案
我无法透露 Xamarin 的具体情况,但通常不可能使用系统旋转机制来旋转屏幕的一部分而不是另一部分(也很难执行诸如仅旋转其中一个屏幕之类的操作) UItabController
的选项卡有效)。您或多或少地陷入了与加速计 (CoreLocation
) Hook 并自行实现部分旋转的困境。
关于iOS 只旋转 subview Controller 之一,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37402394/