iOS开发笔记--去掉tableview中section的headerview粘性
来源:互联网 发布:皇室战争卡牌数据 编辑:程序博客网 时间:2024/05/16 13:52
ios的tableview中headerview会随着滑动黏在上方,直到新的sectionheaderview出现并替换掉,这是个好的特性,但是在为了实现PM某些需求的时候,又不是很符合心意,在网上查了下,找到了其解决方法:
- // 去掉UItableview headerview黏性(sticky)
- - (void)scrollViewDidScroll:(UIScrollView *)scrollView
- {
- CGFloat sectionHeaderHeight = 40;
- 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);
- }
- }
利用控制scrollView的滑动来控制headView显示与否。
0 0
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS开发笔记--去掉tableview中section的headerview粘性
- iOS开发笔记--去掉tableview中section的headerview粘性
- 去掉tableview中section的headerview粘性
- iOS开发Debug之去掉tableView的headerview的粘性
- 去掉ios的tableview中headerview的粘性
- 去掉section的headview粘性
- UITableView去掉headerView和footerView的粘性,随tableview滚动(有瑕疵)
- iOS开发-去掉UITableView HeaderView或FooterView随tableView 移动的黏性(sticky
- iOS开发笔记--多个Section的TableView
- iOS开发笔记--多个Section的TableView
- IOS开发笔记——实现tableView的headerView跟随cell滑动
- ios开发:多个Section的TableView
- ios开发:多个Section的TableView
- ios开发:多个Section的TableView
- iOS开发之去掉UItableview header的粘性
- [LeetCode]022-Generate Parentheses
- JAVA double类型数值,通过NumberFormat类取值的尝试
- log4j properties 配置
- 卸载阿里云盾
- Spring:Aware和事件
- iOS开发笔记--去掉tableview中section的headerview粘性
- Java编程思想学习心得(四)赋值操作符的陷阱
- (二)搭建嵌入式开发环境(ubuntu 12.04)
- stm32_IIC通信协议
- 工资计算系统
- SOCKET 编程的难点yu要点
- EAS如何记录执行业务中记录执行sql的步骤
- ubuntu 14.04 64bit安装32位运行库
- image pre-processing