VIPhotoView 实现图片的基本浏览功能。能够双击放大,拉伸放大等。的确能够减少相当一部分的代码量。
示例代码:
- (void)viewDidLoad { [super viewDidLoad]; UIImage *image = [UIImage imageNamed:@"test.jpg"]; VIPhotoView *photoView = [[VIPhotoView alloc] initWithFrame:self.view.bounds andImage:image]; photoView.autoresizingMask = (1 << 6) -1; [self.view addSubview:photoView]; }