阻止 UIPopover 自动关闭第二部分

发布于 2024-11-30 20:43:01 字数 429 浏览 7 评论 0原文

抱歉,我之前在此处发布了一个问题,但我得到的答案不起作用(可能是我的错)。

基本上,我想阻止 UIPopover 自动关闭。我得到了这段代码:

    - (BOOL) popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
{
    return NO;
}

我输入了它,但它似乎没有任何效果。还有什么我应该补充的吗? 我是否将其放在正确的位置(我将其放在其中包含弹出窗口的视图的 vc.m 中)?

非常感谢,

卢克

Sorry I previously posted a question here, but The answers I got didn't work (probably my fault).

Basically, I want to stop a UIPopover from dismissing automatically. I got to this piece of code:

    - (BOOL) popoverControllerShouldDismissPopover:(UIPopoverController *)popoverController
{
    return NO;
}

which I put in, but it doesn't seem to have any effect. Is there anything else I should add?
am I putting it in the right place (I was putting it in the vc.m of the view that has the popover within it)?

Thanks Very Much,

Luke

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

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

发布评论

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

评论(1

萝莉病 2024-12-07 20:43:01

检查并确保设置了 UIPopover 委托。您可以通过设置 popover 实例变量在代码中执行此操作:

aPopover.delegate = self;

Check to make sure the UIPopover delegate is set. You can do this in code by setting the popover instance variable:

aPopover.delegate = self;

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