Getting the exact location of a UITableViewCell

后端 未结 9 585
滥情空心
滥情空心 2021-01-30 20:10

Given a UITableView, how can I find the location of a specific UITableViewCell? In other words, I want to get its frame relative to my iPhone screen, n

9条回答
  •  走了就别回头了
    2021-01-30 20:49

    If you really need to convert specifically to a point in the window, you could do this:

    [yourAppDelegate.window convertPoint:[cell.contentView.center] fromView:[cell.contentView]];
    

    I used the cells center coordinate, but you could use any point you want.

    Vladimir is right, watch out for rows that are not visible (or that have been recycled).

    -S

提交回复
热议问题