更新时间:2022-01-19 07:45:18
您不需要继承 UITableView
来跟踪滚动。您的 UITableViewDelegate 可以作为 UIScrollViewDelegate
。因此,在委托类中,您可以实现 -scrollViewWillBeginDragging:
或任何 UIScrollViewDelegate
方法在你的情况下。 (正如你提到的问题中的实际建议)
You don't need to subclass UITableView
to track scrolling. Your UITableViewDelegate can serve as UIScrollViewDelegate
as well. So in your delegate class you can implement -scrollViewWillBeginDragging:
or whatever UIScrollViewDelegate
method you need in your situation. (as actually suggested in the question you mention)