Section HeaderView
作者:
xdkoo | 来源:发表于
2015-08-07 23:59 被阅读87次
使用下列代码来控制headerView随tableView的滚动而滚动
CGFloat sectionHeaderHeight = 44;
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);
}else{
scrollView.contentInset = UIEdgeInsetsMake(240, 0, 0, 0);
}
本文标题:Section HeaderView
本文链接:https://www.haomeiwen.com/subject/xwbbqttx.html
网友评论