Please refer to bellow image to get detail:
请参考bellow图像获取细节:
I think, UITableView has some events occur when scrolling em when a group complete replace other, but I don't know :(
我认为UITableView在滚动em时有一些事件发生当一个组完全替换另一个时,但我不知道:
1 个解决方案
#1
2
You can get drawing rectangle for each section using -rectForSection
method (see "Accessing Drawing Areas of the Table View" part in UITableView docs). Then in your UITableViewDelegate implementation you can track scrolling events in table view, e.g. in -scrollViewDidScroll:
method you can compare current contentsOffset
and origin point of the rectangle for each section to determine which section is active at the moment.
您可以使用-rectForSection方法为每个部分绘制矩形(参见UITableView文档中的“访问表视图的绘图区域”部分)。然后在UITableViewDelegate实现中,您可以跟踪表视图中的滚动事件,例如在-scrollViewDidScroll:方法中,您可以比较每个区段当前的contentsOffset和矩形的原点点,以确定当前哪个区段是活动的。
#1
2
You can get drawing rectangle for each section using -rectForSection
method (see "Accessing Drawing Areas of the Table View" part in UITableView docs). Then in your UITableViewDelegate implementation you can track scrolling events in table view, e.g. in -scrollViewDidScroll:
method you can compare current contentsOffset
and origin point of the rectangle for each section to determine which section is active at the moment.
您可以使用-rectForSection方法为每个部分绘制矩形(参见UITableView文档中的“访问表视图的绘图区域”部分)。然后在UITableViewDelegate实现中,您可以跟踪表视图中的滚动事件,例如在-scrollViewDidScroll:方法中,您可以比较每个区段当前的contentsOffset和矩形的原点点,以确定当前哪个区段是活动的。