iOS核心绘图中的缩小缩放限制 [英] Pinch zoom limit in core plot iOS

查看:76
本文介绍了iOS核心绘图中的缩小缩放限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在核心图中实现收缩缩放限制。我认为这是捏变焦的方法。您能帮我在那个方法中做些什么吗?

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;
}

请分享一些示例代码。

推荐答案

如果您更关注结果绘图范围而不是相对缩放比例(通常情况),请使用以下委托方法:

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:

此方法通知您绘图范围即将更改为参数中的范围。您应该检查该范围,根据需要对其进行修改以满足您的要求,然后返回您希望绘图空间使用的范围。在进行任何更改之前调用它。在 Plot Gallery 示例应用程序中有几个用法示例。

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.

这篇关于iOS核心绘图中的缩小缩放限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆