带有 coreplot 图形子视图的 UIScrollView 不经常缩放

发布于 2024-12-29 10:06:06 字数 642 浏览 4 评论 0原文

我有一个带有核心图图形视图子视图的滚动视图。它不经常缩放。如果我们在滚动视图后缩放滚动视图,它将获得缩放。

每次都会调用委托方法 - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView ,但有机会调用委托方法 - (void)scrollViewDidZoom:(UIScrollView *)scrollView< /code> 非常少。

这种行为的原因是什么?

[consumptionGraphView_ addSubview:graphPlottedView_];
[graphPlottedView_ setContentScaleFactor:consumptionGraphView_.contentScaleFactor];

consumptionGraphView_.contentSize = consumptionGraphView_.frame.size;
consumptionGraphView_.minimumZoomScale = 1.0;
consumptionGraphView_.maximumZoomScale = 10.0;
consumptionGraphView_.zoomScale = 0.1;

I have a scrollview with sub-view of core-plot graph view. It does not zoom frequently. If we are zooming the scrollview after scrolling the view, it will get zoom.

Every time the delegate method - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView will get called, but chance of calling the delegate method - (void)scrollViewDidZoom:(UIScrollView *)scrollView is very less.

What is the reason for this behaviour?

[consumptionGraphView_ addSubview:graphPlottedView_];
[graphPlottedView_ setContentScaleFactor:consumptionGraphView_.contentScaleFactor];

consumptionGraphView_.contentSize = consumptionGraphView_.frame.size;
consumptionGraphView_.minimumZoomScale = 1.0;
consumptionGraphView_.maximumZoomScale = 10.0;
consumptionGraphView_.zoomScale = 0.1;

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怪我入戏太深 2025-01-05 10:06:07

该问题是由于 CorePlot 的 GraphHostingView 中存在 UIGestureRecognizers 造成的。

 for (UIGestureRecognizer * recognizer in hostingView.gestureRecognizers) {
        [hostingView removeGestureRecognizer:recognizer];
    }
    

此代码将删除 UIGestureRecognizers,并且图形缩放现在是完美的。

The problem was due to the presence of UIGestureRecognizers in GraphHostingView of CorePlot.

 for (UIGestureRecognizer * recognizer in hostingView.gestureRecognizers) {
        [hostingView removeGestureRecognizer:recognizer];
    }
    

This code will remove the UIGestureRecognizers and the graph zooming is perfect now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文