UITableview Plain风格下 SectionHeader悬浮问题
2016-07-25 10:36
453 查看
在UITableview Plain风格下 SectionHeader在滑动时会始终悬浮在tableview上方,解决办法:
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (scrollView ==
self.contentTableView)
{
CGFloat sectionHeaderHeight =
10; //sectionHeaderHeight
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 {
if (scrollView ==
self.contentTableView)
{
CGFloat sectionHeaderHeight =
10; //sectionHeaderHeight
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);
}
}
}
相关文章推荐
- 在JS中用EL表达式访问request作用域里面的值得问题
- maven的pom文件 Project build error: Unresolveable build extension: Plugin org.sonatype.plugins:nexus-st
- String+ String.Concat String.Format StringBuilder 之间的性能测试
- servlet request请求对象常用方法总结
- HDU 5749 Colmerauer(单调栈)
- 解决SVN上UUID不匹配问题
- @Value取不到值
- ios的手势操作之UIGestureRecognizer浅析
- 【HDU5749 BestCoder Round 84C】【ST-RMQ?NO!暴力跳法or单调栈法 + 贡献思维】Colmerauer 所有子矩阵size乘鞍点权值和
- Builder 构建模式
- vue-router
- Fedora 23 Virtualization Getting Started Guide
- 【HDU 5749】Colmerauer(单调栈+组合数学)
- jenkins插件 build-name-setter
- UEditor学习笔记(三)
- UEditor学习笔记(二)
- UEditor学习笔记(一)
- UIStackView 看我就够了
- POJ 2524 - Ubiquitous Religions
- 制作一个类似苹果VFL的格式化语言来描述UIStackView