去掉UItableview headerview黏性
2015-09-06 10:15
417 查看
//去掉UItableview headerview黏性(sticky)
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 250; //section的高度
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 {
CGFloat sectionHeaderHeight = 250; //section的高度
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);
}
}
相关文章推荐
- ue32编辑器光标怎么变成方的了,不方便啊,怎么改呢?
- 用requests和beautifulsoup爬取豆瓣电影top250,代码及遇到的问题
- iOS 小经验:UIAnimation空对象导致crash
- mysql prepareStatement executeQuery() 内存溢出的解决办法
- Maximum Subsequence Sum【最大连续子序列+树状数组解决】
- Build Systems to Be Zuhanden
- SequenceInputStream(序列流)
- UIViewAnimationOptions类型
- N-Queens II
- DB 查询分析器 6.04 在 Windows 10 上的安装与运行展示
- 用UIKIT的模态对话框要注意的地方
- 基于requests实现极客学院课程爬虫
- UIImage与UIColor互转
- shop++ CriteriaQuery 数据库查询语句
- require/include
- Android UI之Notification
- UISegmentedControl的详细使用
- 基于MVC4+EasyUI的Web开发框架形成之旅--界面控件的使用
- Bestcoder13 1003.Find Sequence(hdu 5064) 解题报告
- 1099. Build A Binary Search Tree (30)