在使用 UITableViewCell 的frame屬性獲取origin得到的坐標(biāo)是不變的.
也就是說(shuō)如果UITableView初始化完畢后,每個(gè)cell的坐標(biāo)是固定的,x不變,y 隨index遞增的.
經(jīng)過(guò)測(cè)試發(fā)現(xiàn),任何一個(gè)cell拖拽或則滑動(dòng)到UITableView的任意相對(duì)位置,cell的frame屬性都沒(méi)有改變.
那怎樣獲取UITableViewCell相對(duì)于UITableView的坐標(biāo)?
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]];
即可完成當(dāng)前cell在屏幕中的坐標(biāo)值