本篇文章主要介绍了"在UITableViewStylePlain情况下sectionHeader可以与tableview一起滑动的解决方法",主要涉及到方面的内容,对于IOS开发感兴趣的同学可以参考一下:
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{CGFloat sectionHeaderHeigh...
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat sectionHeaderHeight = 20;
if (scrollView.contentOffset.y <= sectionHeaderHeight&&scrollView.contentOffset.y > 0) {
scrollView.contentInset = UIEdgeInsetsMake(-scrollView.contentOffset.y, 0, 0, 0);
}elseif (scrollView.contentOffset.y >= sectionHeaderHeight){
scrollView.contentInset = UIEdgeInsetsMake(-sectionHeaderHeight, 0, 0, 0);
}
}
在 -(void)scrollViewDidScroll:(UIScrollView *)scrollView方法中添加上诉代码即可
以上就介绍了在UITableViewStylePlain情况下sectionHeader可以与tableview一起滑动的解决方法,包括了方面的内容,希望对IOS开发有兴趣的朋友有所帮助。
本文网址链接:http://www.codes51.com/article/detail_317095.html