-(void)addCollecviewSub{
self.colorView = [[UIView alloc] initWithFrame:CGRectMake(0, -SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT)]; // 高度随便,只要下拉的高度不超出View的高度就行了
self.colorView.backgroundColor = COLOR(240, 240, 240, 1);
[self.collectionView addSubview:self.colorView];
[self.collectionView sendSubviewToBack:self.colorView];
}
// 代理
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
CGFloat y = scrollView.contentOffset.y;
if (scrollView == self.collectionView) {
if (y < -SCREEN_HEIGHT) {
CGRect frame = self.colorView.frame;
frame.size.height = -y;
frame.origin.y = y;
self.colorView.frame = frame;
}
}
}