弹出框的最大尺寸

发布于 2024-09-15 00:33:59 字数 43 浏览 5 评论 0原文

谁能向我确认 popoverview 的最大尺寸?

谢谢

Could anyone confirm me the maximum size of a popoverview?

Thanks

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

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

发布评论

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

评论(3

疯到世界奔溃 2024-09-22 00:33:59

来自 setPopoverContentSize: 文档:

更改弹出窗口内容的大小时,指定的宽度值必须至少为 320 点且不超过 600 点。高度值没有限制。但是,您指定的宽度和高度值都可以调整,以确保弹出窗口适合屏幕并且不会被键盘覆盖。

From the setPopoverContentSize: documentation:

When changing the size of the popover’s content, the width value you specify must be at least 320 points and no more than 600 points. There are no restrictions on the height value. However, both the width and height values you specify may be adjusted to ensure the popup fits on screen and is not covered by the keyboard.

梦里梦着梦中梦 2024-09-22 00:33:59

我发现 585 似乎是最大的,任何更大的尺寸都会随着尺寸的变化而向左移动。

I've found 585 seems to be the maximum, any larger and the whole thing wanders to the left with each size change.

‘画卷フ 2024-09-22 00:33:59

我刚刚验证了这段代码可以在 iPad 1 和 iPad 4 上运行(这意味着 iOS 5.1.1 - 6.1.2 支持它)。

popover = [[UIPopoverController alloc] initWithContentViewController:yourVC];
    [popover setPopoverContentSize:CGSizeMake(1024, 1024)];

    [popover presentPopoverFromRect:CGRectZero
                                       inView:appDelegate.splitViewController.view
                     permittedArrowDirections:UIPopoverArrowDirectionAny
                                     animated:YES];

您应该注意到,很难关闭弹出窗口,因为它会以纵向或纵向方式“填满屏幕”。景观。我的 appDelegate.splitViewController 中确实有这些方法:

- (BOOL)shouldAutomaticallyForwardRotationMethods {

    NSLog(@"MG - shouldAutomaticallyForwardRotationMethods");
    return YES;
}

- (BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {

    NSLog(@"MG - automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers");
    return YES;
}

只需取消隐藏/隐藏您的 VC 角落中的一个按钮即可关闭:

[popover dismissPopoverAnimated:YES];

还应该注意的是“popover”是一个强大的属性,否则当它出现时您将收到一条已释放的消息试图呈现。

I just verified that this code works on an iPad 1 and iPad 4 (meaning it is supported in iOS 5.1.1 - 6.1.2)

popover = [[UIPopoverController alloc] initWithContentViewController:yourVC];
    [popover setPopoverContentSize:CGSizeMake(1024, 1024)];

    [popover presentPopoverFromRect:CGRectZero
                                       inView:appDelegate.splitViewController.view
                     permittedArrowDirections:UIPopoverArrowDirectionAny
                                     animated:YES];

You should note that it's difficult to dismiss the popover since it will "fill the screen" in portrait or landscape. I do have these methods in my appDelegate.splitViewController:

- (BOOL)shouldAutomaticallyForwardRotationMethods {

    NSLog(@"MG - shouldAutomaticallyForwardRotationMethods");
    return YES;
}

- (BOOL)automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers {

    NSLog(@"MG - automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers");
    return YES;
}

Just unhide/hide a button in a corner of yourVC to dismiss with this:

[popover dismissPopoverAnimated:YES];

It should also be noted that "popover" is a strong property, or you will get a deallocated message when it tries to present.

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