The first step is to use
CGRect rectInTableView = [tableView rectForRowAtIndexPath:indexPath];
which will report the CGRect of a cell within the tableView. However, this value does not change as the tableView scrolls. It is the position relative to the first row of the table (and not the first visible row). To get the position of the cell on the screen you have to convert it to the superviews coordinate system using
CGRect rect = [tableView convertRect:rectInTableView toView:[tableView superview]];
So the following line does it all
CGRect rect = [tableView convertRect:[tableView rectForRowAtIndexPath:indexPath] toView:[tableView superview]]; .
思路其实很简单。一个UITableView就能简单做到了。就像你说的使用-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath这个方法也可以。不过我一般不是那么做。 如果我们按照QQ那样来做。