在使用 UITableViewCell 的frame屬性獲取origin得到的坐標是不變的.
也就是說如果UITableView初始化完畢后,每個cell的坐標是固定的,x不變,y 隨index遞增的.
經過測試發現,任何一個cell拖拽或則滑動到UITableView的任意相對位置,cell的frame屬性都沒有改變.
那怎樣獲取UITableViewCell相對于UITableView的坐標?
google中 http://stackoverflow.com/questions/687793/determine-coordinates-of-a-uitableviewcell-while-scrolling
得出,使用
CGRect rectInTableView = [tableView rectForRowAtIndexPath:indexPath];
CGRect rect = [tableView convertRect:rectInTableView toView:[tableView superview]];
即可完成當前cell在屏幕中的坐標值