#iOS# Pulldown to zoom picture

UIImageView

self.imageView.contentMode = UIViewContentModeScaleAspectFill;
self.imageView.clipsToBounds = YES;

UITableView

[tableHeaderView addSubview:self.imageView];
self.tableView.tableHeaderView = tableHeaderView;

ZoomImage

- (void) scrollViewDidScroll:(UIScrollView *)scrollView
{
    CGFloat yPos = -scrollView.contentOffset.y;
    if (yPos > 0) {
        CGRect imgRect = self.imageView.frame;
        imgRect.origin.y = scrollView.contentOffset.y;
        imgRect.size.height = HeaderHeight+yPos;
        self.imageView.frame = imgRect;
    }
}

你可能感兴趣的:(#iOS# Pulldown to zoom picture)