带有 coreplot 图形子视图的 UIScrollView 不经常缩放
我有一个带有核心图图形视图子视图的滚动视图。它不经常缩放。如果我们在滚动视图后缩放滚动视图,它将获得缩放。
每次都会调用委托方法 - (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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该问题是由于 CorePlot 的 GraphHostingView 中存在 UIGestureRecognizers 造成的。
此代码将删除 UIGestureRecognizers,并且图形缩放现在是完美的。
The problem was due to the presence of UIGestureRecognizers in GraphHostingView of CorePlot.
This code will remove the UIGestureRecognizers and the graph zooming is perfect now.