实现UIScrollViewDelegate的代理方法
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
CGFloat offsetY = scrollView.contentOffset.y;
if (offsetY<0) {
CGFloat scale = 1- (offsetY/50);
scale = (scale>=1)?scale:1;
self.topImage.transform = CGAffineTransformMakeScale(scale, scale);
}
}