gpt4 book ai didi

ios - UIWebView内部ScrollView

转载 作者:行者123 更新时间:2023-12-01 18:15:52 25 4
gpt4 key购买 nike

我试图基于UIWebView内部UIScrollView的zoomScale将缩放转换应用于某些CALayers。但是,我注意到minimumZoomScale / maximumZoomScale值在执行缩放时不断变化。这很好奇,因为单独使用时UIScrollView并不是这样执行的。通常,UIScrollView的zoomScale在已明确设置的最小和最大缩放比例值之间波动。

这是从UIWebView内部UIScrollView中获取的日志

2014-02-21 15:19:36.335 CCCanvasSample[31484:70b] MIN SCALE 1.000000 //Zoomed all the way out
2014-02-21 15:19:36.335 CCCanvasSample[31484:70b] ZOOM SCALE 1.000000
2014-02-21 15:19:36.336 CCCanvasSample[31484:70b] MAX SCALE 7.200000
2014-02-21 15:19:41.433 CCCanvasSample[31484:70b] MIN SCALE 1.000000
2014-02-21 15:19:41.433 CCCanvasSample[31484:70b] ZOOM SCALE 3.179087
2014-02-21 15:19:41.434 CCCanvasSample[31484:70b] MAX SCALE 7.200000
2014-02-21 15:19:46.417 CCCanvasSample[31484:70b] MIN SCALE 0.314534
2014-02-21 15:19:46.418 CCCanvasSample[31484:70b] ZOOM SCALE 2.127526
2014-02-21 15:19:46.418 CCCanvasSample[31484:70b] MAX SCALE 2.264642
2014-02-21 15:19:49.555 CCCanvasSample[31484:70b] MIN SCALE 0.147830
2014-02-21 15:19:49.555 CCCanvasSample[31484:70b] ZOOM SCALE 1.064375
2014-02-21 15:19:49.556 CCCanvasSample[31484:70b] MAX SCALE 1.064375
2014-02-21 15:19:51.598 CCCanvasSample[31484:70b] MIN SCALE 0.138889
2014-02-21 15:19:51.598 CCCanvasSample[31484:70b] ZOOM SCALE 1.000000
2014-02-21 15:19:51.599 CCCanvasSample[31484:70b] MAX SCALE 1.000000 //Zoomed all the way in

这是来自常规UIScrollView的日志:
2014-02-21 15:24:10.342 CCCanvasSample[31540:70b] MIN SCALE 0.033884
2014-02-21 15:24:10.344 CCCanvasSample[31540:70b] ZOOM SCALE 0.033884
2014-02-21 15:24:10.344 CCCanvasSample[31540:70b] MAX SCALE 0.500000
2014-02-21 15:24:14.595 CCCanvasSample[31540:70b] MIN SCALE 0.033884
2014-02-21 15:24:14.596 CCCanvasSample[31540:70b] ZOOM SCALE 0.055143
2014-02-21 15:24:14.596 CCCanvasSample[31540:70b] MAX SCALE 0.500000
2014-02-21 15:24:16.440 CCCanvasSample[31540:70b] MIN SCALE 0.033884
2014-02-21 15:24:16.440 CCCanvasSample[31540:70b] ZOOM SCALE 0.355361
2014-02-21 15:24:16.441 CCCanvasSample[31540:70b] MAX SCALE 0.500000
2014-02-21 15:24:18.503 CCCanvasSample[31540:70b] MIN SCALE 0.033884
2014-02-21 15:24:18.504 CCCanvasSample[31540:70b] ZOOM SCALE 0.500000
2014-02-21 15:24:18.504 CCCanvasSample[31540:70b] MAX SCALE 0.500000

我还注意到,如果我尝试自行设置UIWebView,它将重置其UIScrollView的最小/最大缩放比例。
任何人都可以阐明这种行为吗?

最佳答案

经过一段时间的努力,我能够获得UIWebView的准确缩放比例:

CGFloat accurateZoomScale = webView.scrollView.zoomscale/webView.scrollView.minimumZoomScale;

仍然不确定UIWebView如何操作其内部UIScrollView的细节,但希望这可以节省一些时间。

关于ios - UIWebView内部ScrollView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21944574/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com