我需要缩放 UIImageview 中的 UIImageview,该视图位于 UIView 的 ScrollView 中



我需要缩放 UIImageview 中的 UIImageview,该视图位于 ScrollView 的 UIView 中。我试过这个:

[scroll setMinimumZoomScale:2];
[scroll setZoomScale:10];

但它不起作用为什么?

我实现了该方法

 - (UIView*)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return img1;

}

它可以工作,但移动其他页面的图像并停止滚动

你设置了最大缩放比例吗? 默认值为 1.0。

定义:

@property(nonatomic) float maximumZoomScale;     // default is 1.0. must be > minimum zoom scale to enable zooming

尝试:

[scroll setMinimumZoomScale:2];
[scroll setMaximumZoomScale:12];
[scroll setZoomScale:10];

最新更新