-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (scrollView == _seriesTableView)
{
CGFloat sectionHeaderHeight = 20;
if (scrollView.contentOffset.y <= sectionHeaderHeight
&& scrollView.contentOffset.y >= 0) {
scrollView.contentInset = UIEdgeInsetsMake(- scrollView.contentOffset.y, 0, 0, 0);
}
else if (scrollView.contentOffset.y >= sectionHeaderHeight) {
scrollView.contentInset = UIEdgeInsetsMake(- sectionHeaderHeight, 0, 0, 0);
}
}
UIView *headerView = [[UIView alloc] init];
headerView.backgroundColor = _seriesTableView.backgroundColor;
headerView.frame = CGRectMake(0, 0, _seriesTableView.width, 10);
_seriesTableView.tableHeaderView = headerView;