当前位置: 首页 > 工具软件 > YYImage > 使用案例 >

YYImage

徐文彬
2023-12-01

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {

    CGFloat viewHeight = scrollView.height + scrollView.contentInset.top;

    for (YYWebImageExampleCell *cell in [self.tableView visibleCells]) {

        CGFloat y = cell.centerY - scrollView.contentOffset.y;

        CGFloat p = y - viewHeight / 2;

        CGFloat scale = cos(p / viewHeight * 0.8) * 0.95;

        if (kiOS8Later) {

            [UIView animateWithDuration:0.15 delay:0 options:UIViewAnimationOptionCurveEaseInOut | UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionBeginFromCurrentState animations:^{

                cell.webImageView.transform = CGAffineTransformMakeScale(scale, scale);

            } completion:NULL];

        } else {

            cell.webImageView.transform = CGAffineTransformMakeScale(scale, scale);

        }

    }

}

相关阅读

相关文章

相关问答