In the process of image processing, we often encounter image scaling requirements. In the past, we used a pinch gesture to scale the Image view, below is a brief introduction to the image scaling function provided by scrollView: first, implement the UIScrollerViewDelegate protocol and set its delegate to set the maximum magnification: maximumZoomScale is of the float type and the minimum magnification: minimumZoomScale implementation-(UIView *) viewForZoomingInScrollerView :( UIScrollerVIew *) scroller {} method can be used as an example: [html] scrollerView = [[UIScrollView alloc] initWithFrame. view. bounds]; scrollerView. delegate = self; scrollerView. minimumZoomScale = 0.5f; scrollerView. maximumZoomScale = 2.0f; UIImageView * imageView = [[UIImageView alloc] initWithFrame: self. view. bounds]; [imageView setImage: [UIImage imageNamed: @ "20091121014197_2.jpg"]; [scrollerView addSubview: imageView]; [self. view addSubview: scrollerView]; [html]-(UIView *) viewForZoomingInScrollView :( UIScrollView *) scrollView {for (id view in [scrollerView subviews]) {if ([view isKindOfClass: [UIImageView class]) {return view;} return nil ;}