iOS开发笔记--去掉tableview中section的headerview粘性
来源:互联网 发布:桌面文件夹归类软件 编辑:程序博客网 时间:2024/05/10 16:46
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显示与否。
转自:http://fisher-me.net/?p=495
1 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的粘性
- 普通表转分区表方法总结
- JSoup获取网页中的链接
- 如何使用C#创建WebService
- Android获取AndroidMenifest.xml中的meta-data数据
- WM_MOUSELEAVE和WM_MOUSEHOVER使用
- iOS开发笔记--去掉tableview中section的headerview粘性
- PAT1086(二叉树)
- java “/” 和 "\"
- AWK使用实例
- 数据可视化Data-Driven Documents
- 一座城,一个人
- 深入浅出Mybatis-与Spring集成
- 2014年车用显示器面板出货增三成
- vim基本命令