首页 > 代码库 > iOS 图片点击放大, 再次点击缩小

iOS 图片点击放大, 再次点击缩小

XWScanImage  是一个自定义的类, 评论留Q 发

 

 ImageView = [[UIImageView alloc]init];

    

    ImageView.backgroundColor = SetColor(160, 160, 160);

    //为UIImageView1添加点击事件

    UITapGestureRecognizer *tapGestureRecognizer1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(scanBigImageClick1:)];

    [ImageView addGestureRecognizer:tapGestureRecognizer1];

 

#pragma mark 图片的点击放大缩小

-(void)scanBigImageClick1:(UITapGestureRecognizer *)tap{

    NSLog(@"点击图片");

    UIImageView *clickedImageView = (UIImageView *)tap.view;

    [XWScanImage scanBigImageWithImageView:clickedImageView];

}

 

iOS 图片点击放大, 再次点击缩小