#define screenHeightRadio (mainScreenHeight/(([[[UIDevice currentDevice] systemVersion] floatValue]>=7.0)?568.0:(568.0-20)))
/* UITableView HeaderInSection 禁止 悬停 */
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat sectionHeaderHeight = 20 * screenHeightRadio;
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);
}
}
UITableView HeaderInSection 禁止悬停
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。
推荐阅读更多精彩内容
- 当 UITableView 的 style 属性设置为 Plain 时,这个tableview的section h...
- 当UITableView的style属性设置为Plain时,这个tableview的section header在...
- 主要是对悬浮条的处理,刚开始考虑在view上添加一份同样布局的view,通过隐藏和显示来实现,由于存在两个同样布局...
- UITableView的style无论是plain还是grouped样式,都可以设置组头组尾视图(通过代理方法)。...