我有一个UI
ImageView.我需要捏缩放.
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0,90,320,38)]; [imageView setImage:[UIImage imageNamed:@"accesspanel.png"]]; [self.view addSubview: imageView];
解决方法
您可以在scrollview中添加imageview,并可以使用Scrollview委托来实现此目的
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return self.imageView; } - (void)viewDidLoad { [super viewDidLoad]; self.scrollView.minimumZoomScale=0.5; self.scrollView.maximumZoomScale=6.0; self.scrollView.contentSize=CGSizeMake(1280,960); self.scrollView.delegate=self; }