如果是UICollectionView,要获取cell中view相对屏幕的frame的方法为: // imageView为目标view,cell的subView; cell为UICollectionViewCell; CGRect imageVRect = [cell convertRect:imageView.frame toView:cell]; CGRect realRect = [cell convertRect:imageVRect toView:self.view];
a shopCartDemo with animation
如果是UICollectionView,要获取cell中view相对屏幕的frame的方法为: // imageView为目标view,cell的subView; cell为UICollectionViewCell; CGRect imageVRect = [cell convertRect:imageView.frame toView:cell]; CGRect realRect = [cell convertRect:imageVRect toView:self.view];
a shopCartDemo with animation