标签:style blog color io sp div on cti log
去掉UITableView HeaderView或FooterView随tableView 移动的黏性(sticky)
控制器中实现以下方法即可:
1 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { 2 3 CGFloat sectionHeaderHeight = 40; 4 5 if (scrollView.contentOffset.y<=sectionHeaderHeight&&scrollView.contentOffset.y>=0) { 6 7 scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0); 8 9 } else if (scrollView.contentOffset.y>=sectionHeaderHeight) { 10 11 scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0); 12 13 } 14 15 }
去掉UITableView HeaderView或FooterView随tableView 移动的黏性
标签:style blog color io sp div on cti log
原文地址:http://www.cnblogs.com/myios/p/4024875.html