如何实现像safari broswer一样的两根手指平移?

发布于 2024-09-09 06:03:56 字数 166 浏览 1 评论 0原文

我尝试在 ipad 中实现像 safari 浏览器一样的平移和缩放功能。

我使用 UIPinchGestureRecognizer 通过两根手指触摸进行缩放。但我不知道如何实现两根手指平移。

当我用两根手指触摸时,其点击次数为 1。

请帮忙。

提前致谢。

i try to implement panning and zooming functionality like safari browser in ipad.

i used UIPinchGestureRecognizer for zooming with two fingers touch. but i dont know how to implement two fingers panning.

when i touch with two fingers its tap count is 1.

please help.

thanks in advance.

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

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

发布评论

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

评论(1

心碎无痕… 2024-09-16 06:03:56

您不需要 tapCount,您需要触摸次数。如果您用两根手指按下,则可以进行两次触摸事件,每次点击计数为 1。

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

[触摸计数] 将返回 2,每个指尖一个。

通读苹果触摸事件指南

You don't want the tapCount, you want the number of touches. If you touch down with two fingers you can two touch events each with a tap count of 1.

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event

[touches count] would return 2, one for each finger tip.

Read through the apple guide for touch events

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