UISplitViewController 与 UIPopoverController 在旋转时崩溃

发布于 2024-10-08 17:48:43 字数 257 浏览 0 评论 0原文

当在 Portrait 中使用 UISplitViewController 时,我会显示一个设置弹出框。如果我在显示弹出窗口时将设备旋转为横向,则应用程序会崩溃。

这是因为 iPad 一次只能显示一个弹出窗口,而 UISplitViewController 在旋转时显示一个弹出窗口 - 这发生在任一视图收到 deviceWillRotate 消息之前。

我是否可以捕获另一条消息,以便在 UISplitViewController 显示弹出窗口之前关闭我的弹出窗口?

When using a UISplitViewController in portrait , I have a settings popover that I display. If I rotate the device to landscape while the popover is displayed, the app crashes.

This is because the IPad can only display one popover at a time, and the UISplitViewController shows a popup on rotate -- and that happens BEFORE either view gets a deviceWillRotate message.

It there another message I can capture so I can dismiss my popup before the UISplitViewController shows it's popup?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城°AllureLove 2024-10-15 17:48:43

我需要的是 UISplitViewControllerDelegate 方法。有一个方法会在创建弹出窗口之前被调用。这就是我需要的钩子。

What I needed was the UISplitViewControllerDelegate methods. There is a method that gets called right before the popover is created. That was the hook I needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文