Determine coordinates of a UITableViewCell while scrolling

后端 未结 4 1915
生来不讨喜
生来不讨喜 2020-12-02 21:14

My goal is to have the UITableViewCells fade in/out when they are approaching the bounds of the UITableView and about to be covered/revealed.

The approach I have bee

4条回答
  •  独厮守ぢ
    2020-12-02 22:01

    I suspect the cells are held within 'cell sized' subViews of the UITableView so you are seeing a frame relative to that view.

    I don't have an actual an answer for you but, I would suggest checking out UIScrollView's delegate class: UIScrollViewDelegate. It responds to – scrollViewDidScroll: and you can manually work out your offset from that. UIScrollView is a superclass of UITableView.

    You can convert points (such as your origin) to another view's co-ordinates using UIView's - (CGPoint)convertPoint:(CGPoint)point toView:(UIView *)view method.

提交回复
热议问题