Getting the exact location of a UITableViewCell

后端 未结 9 574
滥情空心
滥情空心 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:58

    You could also use the rectForRowAtIndexPath method to get the location of a UITableView by sending the indexPath for that.

    - (CGRect)rectForRowAtIndexPath:(NSIndexPath *)indexPath
    

    So use as below:

    CGRect myRect = [tableView rectForRowAtIndexPath:indexPath];
    

提交回复
热议问题