Pinch zoom limit in core plot iOS

泪湿孤枕 提交于 2019-12-13 04:41:47

问题


I have to implement pinch zoom limit in core plot. I think this is the method for pinch zoom. Could you please help what should I do in that mehtod:

(BOOL)plotSpace:(CPTPlotSpace *)space shouldScaleBy:(CGFloat)interactionScale aboutPoint:(CGPoint)interactionPoint 
{
    return YES;
}

Could you please share some sample code.


回答1:


If you a more concerned about the resulting plot range rather than the relative scaling amount (a common case), use this delegate method:

-plotSpace:willChangePlotRangeTo:forCoordinate:

This method informs you that a plot range is about to change to the range in the parameters. You should inspect that range, modify it as needed to meet your requirements, and return the range you want the plot space to use. It is called before any change. There are several examples of usage in the Plot Gallery example app.



来源:https://stackoverflow.com/questions/24422842/pinch-zoom-limit-in-core-plot-ios

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