让tableview的每个section的headerview随tableview一起滚动
2015-02-27 09:13
274 查看
//去掉UItableview headerview黏性
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.myTableView)
{
CGFloat sectionHeaderHeight = YOUR_HEIGHT;
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);
}
}
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView == self.myTableView)
{
CGFloat sectionHeaderHeight = YOUR_HEIGHT;
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);
}
}
}
相关文章推荐
- tableView的每个section 的headerView或者footerView随tableView一起滚动
- 让tableView的每个section的headerview随tableview一起滚动
- 不让tableview的每个section的headerview随tableview一起滚动
- 让tableview的每个section的headerview随tableviewo一起滚动
- tableview中需要header随着cell一起滚动
- 怎么让tableview的section的headerView随着cell一起滑动
- 如何设置ios tableView的section跟着tableView一起滚动
- 让UITableView 的 headerView跟随 cell一起滚动,tableHeaderView
- iOS section 随tableview一起滚动
- ios tableview 那些事(二十三) 解决headerView不随cell一起滚动的问题
- TableView viewForHeaderInSection 随滚动条滚动 无遮挡
- tableview自定义每个section的title
- iOS开发笔记--去掉tableview中section的headerview粘性
- 如何让 UITableView 的 headerView跟随 cell一起滚动
- (转) 如何让 UITableView 的 headerView跟随 cell一起滚动
- ios:改变tableview的titleForHeaderInSection字体颜色设置
- iOS7之后的tableView的group布局header以及footer的section
- 关于UITableView中每个section的header显示
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS tableview viewForHeaderInSection 自定义