这里我用的是MJRefresh,给MJ的下拉刷新加背景颜色的话只能加相当于一个cell的距离,然而我们实际需求是下滑的那些颜色也是要和下拉刷新的背景颜色相同,所以这里我只能自己加一个遮罩View
self.refreshBgV = [[UIView alloc] initWithFrame:CGRectMake(0, -kScreenH, kScreenW, kScreenH)];
self.refreshBgV.backgroundColor = RGBColor(0xe5e5e5);
[self.view addSubview:self.refreshBgV];
#pragma mark UIScrollView
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
CGRect frame = self.refreshBgV.frame;
frame.origin.y = frame.origin.y - (scrollView.contentOffset.y - last);
self.refreshBgV.frame = frame;
last = scrollView.contentOffset.y;
[self.view setNeedsLayout];
}
这样可实现效果