您的位置:首页 > 移动开发 > IOS开发

IOS 去除 tableView 中 headerView 吸附头部,不整体滚动

2015-09-30 00:00 441 查看
摘要: IOS 去除 tableView 中 headerView 吸附头部,不整体滚动

//去掉 UItableview headerview 黏性(sticky)
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.tableViewOrder)
{
CGFloat sectionHeaderHeight = 60; //sectionHeaderHeight
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);
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: