利用UITableiew实现下拉放大图片

表格头视图实现下拉放大图片需要签订

// 下拉放大图片

-(void)xialafangda{

UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, -200, [UIScreen mainScreen].bounds.size.width, 200)];

imageView.image = [UIImage imageNamed:@"壁纸112.jpg"];

imageView.contentMode = UIViewContentModeScaleAspectFill;

imageView.tag = 101;

imageView.clipsToBounds = YES;

[self.theTable addSubview:imageView];

}

- (void)scrollViewDidScroll:(UIScrollView *)scrollView

{

CGPoint point = scrollView.contentOffset;

if (point.y < -200) {

CGRect rect = [self.theTable viewWithTag:101].frame;

rect.origin.y = point.y;

rect.size.height = -point.y;

[self.theTable viewWithTag:101].frame = rect;

}

}

你可能感兴趣的:(利用UITableiew实现下拉放大图片)