UISplitViewController 旋转
UISplitViewController 如何知道它何时旋转,以便可以通过管理其视图来触发适当的行为?有什么办法可以让我自己手动触发它吗?我有一个分割视图控制器,它拥有一个不在层次结构根部的视图,因此它没有获取(我认为)通常允许它处理旋转行为的旋转事件。
How does a UISplitViewController know when it has rotated so that it can trigger the appropriate behavior with managing its views? Is there some way I can manually trigger it myself? I have a split view controller owning a view that is not at the root of my hierarchy, so it is not getting the rotation events that (I think) normally allow it to handle rotation behavior.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试实现 UISplitViewController 委托,即:
// Landscape mode
– splitViewController:willShowViewController:invalidatingBarButtonItem:
// Portrait mode
– splitViewController:willShowViewController:invalidatingBarButtonItem:
由于 masterView (左)将在旋转发生时相应地显示/隐藏,我发现与处理方向变化相比,如果每个视图
You can try to implement UISplitViewController delegate which is:
// Landscape mode
– splitViewController:willShowViewController:invalidatingBarButtonItem:
// Portrait mode
– splitViewController:willShowViewController:invalidatingBarButtonItem:
Since the masterView (left) will show/hide accordingly when the rotation occurs, I found this is more effective compared to handling the orientation changes if each view
我猜 UiSplitViewController 不会自动旋转并且
iPad:SplitView 不旋转 几乎可以说,除非控制器的视图是根视图,它不会起作用。哦,苹果。
I guess UiSplitViewController doesn't autorotate and
iPad: SplitView does not rotate pretty much say that unless the controller's view is the root view, it won't work. Oh apple.
您可以注册方向更改的通知,确保您也将 shouldAutorotateToInterfaceOrientation 设置为 YES,以支持您想要支持的旋转。
You could sign up for notifications of orientation changing, make sure you have shouldAutorotateToInterfaceOrientation set to YES for the rotations you want to support as well.