去除UITableView的粘滞性(stick)
http://stackoverflow.com/questions/9602966/uitableview-with-static-headers
关键代码段:
Below is one solution:
-(void)scrollViewDidScroll:(UIScrollView*)scrollView {CGFloat sectionHeaderHeight =40;if(scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0){
scrollView.contentInset =UIEdgeInsetsMake(-scrollView.contentOffset.y,0,0,0);}elseif(scrollView.contentOffset.y>=sectionHeaderHeight){
scrollView.contentInset =UIEdgeInsetsMake(-sectionHeaderHeight,0,0,0);}}
However it will have a bit of flicker while header reaches to top.
One more soultion is to make Grouped table view.
One more thing is to add a section with zero rows at the top and simply use the footer of the previous section as a header for the next.