scollview下拉视图方大

#pragma mark -- UIScrollViewDelegate 协议方法
//scollview滑动的时候做视图放大
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    
    CGFloat offset = self.scrollview.contentOffset.y;
    
    if (offset > 0) {
        return;
    }
    
    CGFloat transformNumber = (self.homeImageView.bounds.size.height - offset) / self.homeImageView.bounds.size.height ;
    
    [UIView animateWithDuration:0.00001 animations:^{
        
        self.homeImageView.transform = CGAffineTransformMakeScale(transformNumber, transformNumber);
        self.homeImageView.center = CGPointMake(self.homeImageView.center.x, 200 - fabs(offset)/2);
    }];
}

你可能感兴趣的:(scollview下拉视图方大)