当作为collectionViewCell的tableView的样式为plain时
Simulator Screen Shot 2016年2月2日 下午3.04.12.png Simulator Screen Shot 2016年2月2日 下午3.03.53.png
tabeleView滑动的时候 由于UITableView的粘着性
Simulator Screen Shot 2016年2月2日 下午3.06.19.png
解决一:将UITableView的plain改为group
效果:
解决二:UITableView的样式为plain
-
(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat sectionHeaderHeight = 55;
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);
}
}
效果:
Simulator Screen Shot 2016年2月2日 下午3.10.48.png
参考:UITableView的粘着性------------->
https://github.com/facebook/react-native/issues/1974
去掉UItableView的粘着性----------->
http://blog.sina.com.cn/s/blog_801997310102vpa1.html
网友评论