您的位置:首页 > 其它

table header 随cell上滑

2016-04-12 16:14 399 查看
//去掉UItableview headerview黏性
func scrollViewDidScroll(scrollView:
UIScrollView) {
let sectionHeaderHeight =
45 as
CGFloat
let yPostion = scrollView.contentOffset.y
as CGFloat
scrollView.contentInset =
UIEdgeInsetsMake(-scrollView.contentOffset.y,
0, 0,
0);
if((sectionHeaderHeight >= yPostion)&&(yPostion >=
0)){
scrollView.contentInset =
UIEdgeInsetsMake(-scrollView.contentOffset.y,
0, 0,
0);
} else
if (yPostion >= sectionHeaderHeight) {
scrollView.contentInset =
UIEdgeInsetsMake(-sectionHeaderHeight,
0, 0,
0);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: