iOS开发 TableView的headerInSectionView 不悬浮
2017-10-17 09:38
316 查看
// UITableView的Style为Plain时, 当tableView上移顶端的tableHeaderView会跟着滑出窗口, 而headerInsectionView则会悬浮固定在窗口顶端不随着滑动继续上移. // UITableView的Style为Grouped时, 当tableView上移顶端的tableHeaderView会跟着滑出窗口, 而headerInsectionView则会随着滑动继续上移. // UITableView的Style为Plain时禁止headerInsectionView固定在顶端: - (void)scrollViewDidScroll:(UIScrollView *)scrollView { CGFloat sectionHeaderHeight = 30; 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); } }
相关文章推荐
- iOS开发-设置headerInsectionView不悬浮
- iOS开发-设置headerInsectionView不悬浮
- iOS开发:Xcode 7之后viewForHeaderInSection、viewForFooterInSection设置内容不产生效果的解决方法
- 【iOS开发】关于Xcode8后产生的viewForHeaderInSection、viewForFooterInSection设置不产生效果的问题
- iOS开发UI— QQ好友列表(处理头部控件的点击)viewForHeaderInSection:
- ios开发之--ios11适配:TableView的heightForHeaderInSection设置高度无效/UISearchBar消失
- iOS开发笔记--去掉tableview中section的headerview粘性
- 【iOS】tableView:viewForHeaderInSection: 方法未调用
- 设置headerInsectionView不悬浮
- iOS开发- tableView取消头部(section header)悬停效果
- iOS开发笔记--去掉tableview中section的headerview粘性
- ios:改变tableview的titleForHeaderInSection字体颜色设置
- iOS开发——heightForHeaderInSection设置高度无效
- iOS tableview viewForHeaderInSection 自定义
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS UITableView:section的Header以及Footer不悬浮停留在屏幕的方法(非在scrollView代理实现的方法)
- iOS开发笔记--去掉tableview中section的headerview粘性
- UITableView设置headerInsectionView不悬浮
- iOS中tableView每一个section的header的悬浮位置的解决