去掉UItableview headerview黏性
来源:互联网 发布:解压rar的软件 编辑:程序博客网 时间:2024/04/28 15:44
前言
有时候使用UITableView所实现的列表,会使用到section,但是又不希望它粘在最顶上而是跟随滚动而消失或者出现,下面的代码片段就是实现此功能:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { if (scrollView == _tableView) { CGFloat sectionHeaderHeight = 36; 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); } } }
说明
- sectionHeaderHeight 的值要根据自己的而定
- _tableView 如果一个类里有多个表格,要明确指明要去掉哪一个表格头的粘性
0 0
- 去掉UItableview headerview黏性
- 去掉UItableview headerview黏性
- 去掉UItableview headerview黏性
- 去掉UItableview headerview黏性
- 去掉UItableview headerview黏性
- 去掉UItableview headerview黏性
- 去掉UItableview headerview黏性(sticky)
- 去掉UItableview headerview黏性(sticky)
- 去掉UItableview headerview黏性(sticky)
- // 去掉UItableview headerview黏性(sticky)
- 去掉UItableview headerview黏性(sticky)
- 去掉UItableview headerview(组标题)黏性
- UItableview section headerview黏性
- 掉UItableview headerview黏性
- // 去掉UItableview headerview黏性(sticky) - (void)scrollViewDidScroll:(UIScrollView *)scrollView {
- sectionheadView 跟随UItabview滚动 去掉UItableview headerview黏性
- 去除 UItableview headerview黏性(sticky)
- iOS开发-去掉UITableView HeaderView或FooterView随tableView 移动的黏性(sticky
- 给 Linux 系统“减肥”,系统垃圾清理
- Linux groupdel --删除群组
- 算法_动态规划_漂亮打印
- JS在页面Frame和子Frame之间的调用
- adb不是内部命令 --windows系统
- 去掉UItableview headerview黏性
- Linux groupmod --修改用户组
- C++第二次实验作业
- 一个Demo让你掌握Android所有控件
- Jama.Matrix的学习
- mongodb 添加用户及权限设置详解
- opencv读取图片,视频文件,摄像头
- Android 开发工具整理
- 绑定ip和mac