使弹出窗口视图大小正确时遇到问题

发布于 2024-10-20 22:05:24 字数 526 浏览 7 评论 0原文

当用户单击文本字段时,我显示一个弹出窗口。弹出窗口视图有一个选择器视图,但我在删除视图弹出窗口中的一些空白时遇到了一些麻烦。 它看起来像这样:

在此处输入图像描述

我认为我的弹出窗口大小可能是固定的,因为我在以下情况下显示它用户开始编辑文本字段:

[popoverController presentPopoverFromRect:textField.frame inView:self.view   permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 

关于如何使弹出窗口视图更小或使所有内容都能很好地适应有什么想法吗? 我也尝试过这行代码,但没有成功:

self.contentSizeForViewInPopover=CGSizeMake(360.0,220.0);

提前致谢。

I am displaying a popover when user clicks into text field. The popover view has a picker view but I am having some trouble getting rid of some white space in the view popover .
This is what it looks like:

enter image description here

I think my popover size might be fixed because I display it like this when user begins editing textfield:

[popoverController presentPopoverFromRect:textField.frame inView:self.view   permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; 

Any ideas on how to make the popover view smaller or for everything to fit in nicely?
I also played around with this line of code but no success:

self.contentSizeForViewInPopover=CGSizeMake(360.0,220.0);

thanks in advance.

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

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

发布评论

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

评论(1

魔法唧唧 2024-10-27 22:05:24

您确定将选择器的原点设置为 {0, 0} 吗?

Are you sure you're setting the picker's origin to {0, 0}?

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