让UITableView的表头随着tableView一起滚动
2016-05-06 11:40
405 查看
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { //UIScrollViewDelegate
CGFloat sectionHeaderHeight = headviewHeight;
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);
}
}
http://www.cocoachina.com/bbs/read.php?tid=248691
CGFloat sectionHeaderHeight = headviewHeight;
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);
}
}
http://www.cocoachina.com/bbs/read.php?tid=248691
相关文章推荐
- 动态获取UILabel的bounds
- UITableView设置单元格选中后只显示一个打勾的三种简单方法(仅供参考)
- UITableView设置单元格选中后只显示一个打勾的三种简单方法(仅供参考)
- ios学习笔记之UIView
- Android UI性能优化实战 识别绘制中的性能问题
- UITextField左侧的表达图片(..我也不知道叫什么)
- DelayQueue的原理和使用浅谈
- Leetcode 303 Range Sum Query - Immutable
- UE4 下载4.11.2的时候:当前遇到连接问题,正在重试
- chmod命令高级篇( SetUID与SetGID标识位)
- UITextField的使用总结
- codeforces 670E. Correct Bracket Sequence Editor
- android线程间通信和主线程更新ui
- UIRectEdgeNone
- MP 新版本 [2 mysql sequelize 搭建数据库]
- PriorityBlockingQueue详解
- Request获取url各种信息的方法
- CBATTRequest 学习笔记
- 如何更好地限制一个UITextField的输入长度
- [转]UItableViewCell的复用机制