如何控制UISCrollview的缩放和缩放速度? [英] How do you control pinch and zoom speed for a UISCrollview?

查看:155
本文介绍了如何控制UISCrollview的缩放和缩放速度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

捏和缩放过于过于逼真的动画,需要将其调低一个档次.

Pinch and zoom is way too violent of an animation need to turn it down a notch.

推荐答案

好吧,我想到了这个:

因为速度似乎取决于最小和最大滚动速度,所以每次使用uiscroll委托进行实际缩放时,我都会将它们保持在最小和最大缩放附近.

since speed seems to be dependent on the min and max scroll speeds i kept them close to the min and max zooms every time it actually zooms using the uiscroll delegate

- (void)scrollViewDidZoom:(UIScrollView *)scrollView {

 if(scrollView.multipleTouchEnabled){

 CGFloat fSpeedZoom=.02;

 scrollView.maximumZoomScale=scrollView.zoomScale+fSpeedZoom;
 scrollView.minimumZoomScale=scrollView.zoomScale-fSpeedZoom;

 if(scrollView.maximumZoomScale>fMaxZoomScale) SV.maximumZoomScale=fMaxZoomScale;
 if(scrollView.minimumZoomScale<fMinZoomScale) SV.minimumZoomScale=fMinZoomScale;

 }
}

如果还有其他方法,或者如果有缺陷,那将是一件好事.

would be good to hear f there are other ways, or if this is flawed.

这篇关于如何控制UISCrollview的缩放和缩放速度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆