iOS图片浏览器的简单封装
jopen
9年前
#pragma mark 图片点击 -(void)imageTap:(UITapGestureRecognizer *)tap{ NSMutableArray *photos = [NSMutableArray array]; for (int i=0; i<self.imageViews.count; i++) { UIImageView *child = self.imageViews[i]; JLPhoto *photo = [[JLPhoto alloc] init]; //原始imageView photo.sourceImageView = child; //要放大图片URL photo.bigImgUrl = self.bigImgUrls[i]; //标志 photo.tag = i; [photos addObject:photo]; } JLPhotoBrowser *photoBrowser = [[JLPhotoBrowser alloc] init]; //photo数组 photoBrowser.photos = photos; //当前位置 photoBrowser.currentIndex = (int)tap.view.tag; [photoBrowser show]; }