How do you control pinch and zoom speed for a UISCrollview?

心已入冬 提交于 2019-12-02 07:35:45
yeahdixon

well i came up with this:

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!