Neo
Neo

Reputation: 936

UIScrollView with subview of coreplot graph doesnot zoom frequently

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;

Upvotes: 1

Views: 937

Answers (1)

Neo
Neo

Reputation: 936

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.

Upvotes: 2

Related Questions