弹出窗口的箭头用于跟踪滚动视图中的对象

发布于 2024-09-13 18:03:50 字数 381 浏览 5 评论 0原文

每当触摸表格视图中的单元格时,我都会显示一个弹出窗口,箭头指向该单元格,并且始终指向左侧或右侧,而不是向上或向下。

表视图被设置为弹出窗口的 passthroughView,以便用户可以在弹出窗口仍然打开时选择不同的单元格,从而为所选单元格生成一个新的弹出窗口。

但是,这意味着用户还可以在弹出窗口打开时滚动表格。发生这种情况时,如何使弹出窗口的箭头继续指向所选单元格?

不幸的是,UITableView,而不是包含在 UIScrollView 中,所以我不能简单地在 tableview 的坐标系中呈现弹出框。此外,表格单元格似乎没有定义的框架来呈现弹出窗口。我在 API 中没有看到任何手动移动弹出框箭头的方法。

有什么想法吗?谢谢。

I show a popover whenever a cell in my tableview is touched, with the arrow pointing to the cell, and always pointing left or right, not up or down.

The table view is set as the popover's passthroughView, so that the user can select a different cell while the popover is still open, resulting in a new popover for the selected cell.

However, this means that the user can also scroll the table while the popover is open. When this happens, how can I make the popover's arrow continue to point at the selected cell?

Unfortunately, UITableView is, not is contained in, a UIScrollView, so I can't simply present the popover in the tableview's coordinate system. Also, table cells do not seem to have a defined frame to present the popover from. I don't see any way in the API to move the popover's arrow manually.

Any ideas? Thanks.

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

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

发布评论

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

评论(1

遇见了你 2024-09-20 18:03:50

事实证明,即使弹出框已经呈现,您也可以使用 presentPopoverFromRect:InView: ;这将导致弹出控制器重新计算其箭头位置。

It turns out, you can use presentPopoverFromRect:InView: even when the popover has already been presented; this will cause the popover controller to recompute its arrow position.

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