操作表内的 UIPickerView 下半部分不响应

发布于 2024-09-30 11:08:39 字数 337 浏览 0 评论 0原文

我使用以下教程在 UIActionSheet 内创建了一个 UIPickerView添加 UIPickerView 和操作表中的按钮 - 如何?

我注意到 UIPickerView 不会响应 UIPicker 下半部分以下的触摸。也许位于选择栏下方,但不再位于下方。

有没有人有类似经历并解决的?

I created a UIPickerView inside an UIActionSheet, using the following tutorial:
Add UIPickerView & a Button in Action sheet - How?

I've noticed that the UIPickerView does not respond to touches below the bottom half of the UIPicker. Perhaps just below the selection bar, but not any more below.

Has anyone had any similar experiences and resolved them?

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

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

发布评论

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

评论(2

演出会有结束 2024-10-07 11:08:40

我最近遇到了类似的问题,我提出了 3 个选项和一个取消。下面的 3 个按钮似乎有半个按钮未对齐。我必须在按钮之间单击才能让它们运行。这完全取决于我从哪里提交行动表。如果你有一个 TabBarController,你应该从那里呈现操作表:

[actionSheet showInView:self.parentViewController.tabBarController.view];

如果你只有视图本身,也许还有一个导航栏,那么从视图中呈现它就可以了:

[actionSheet showInView:self.view];

在我的例子中,我有一个用于 iphone 的选项卡栏,而不是用于 iphone 的选项卡栏。 ipad 版本,所以我这样做了:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    [actionSheet showInView:self.view];
} else {
    [actionSheet showInView:self.parentViewController.tabBarController.view];
}

从 UIActionSheet 参考文档中尚不清楚,但从“最前面”的最合理的控制器中呈现操作表可能是明智的。因此,如果底部有一个工具栏,则从那里显示它。这些限制似乎不适用于 iPad,因为操作表显示在弹出窗口内。

希望有帮助。

I had a similar problem recently where I was presenting 3 options and a cancel. The lower 3 buttons seemed about half a button out of alignment. I had to click inbetween the buttons to get them to operate. It all depended on where I was presenting the action sheet from. If you have a TabBarController you should present the action sheet from there:

[actionSheet showInView:self.parentViewController.tabBarController.view];

If you just have the view itself, with perhaps a navbar then presenting it from the view is fine:

[actionSheet showInView:self.view];

In my case I had a tab bar for the iphone and not for the ipad version so I did this:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    [actionSheet showInView:self.view];
} else {
    [actionSheet showInView:self.parentViewController.tabBarController.view];
}

It's not clear from the UIActionSheet reference documentation but it might be wise to present the action sheet from the 'front' most controller that is sensible. So if there is a toolbar at the bottom present it from that. These restrictions do not appear to apply to the iPad as action sheets are presented inside popovers.

Hope that helps.

南风几经秋 2024-10-07 11:08:40

嘿,转到 XIB 并尝试选择 UIPickerView,然后转到“布局”菜单和“置于前面”希望这会有所帮助!

Hey go to XIB and try selecting the UIPickerView and Then Go to "Layout" Menu and "Bring To Front" Hope this helps!!

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