Popover的箭头用于跟踪滚动视图中的对象 [英] Popover's arrow to track an object in a scrollview

查看:84
本文介绍了Popover的箭头用于跟踪滚动视图中的对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

表格视图设置为popover的 passthroughView ,这样用户可以在弹出窗口仍处于打开状态时选择不同的单元格,从而为所选单元格生成新的弹出窗口。

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.

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

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?

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

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.

任何想法?谢谢。

推荐答案

事实证明,你可以使用 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.

这篇关于Popover的箭头用于跟踪滚动视图中的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆