Android 中检测捏合

发布于 2024-08-28 17:06:46 字数 171 浏览 5 评论 0原文

我想在我的 Android 应用程序中处理捏合事件来放大和缩小。

我相信 Android 2.0 具有多点触控功能,并且听说 Android 1.6 可能支持也可能不支持,具体取决于设备。

检测捏合事件的最佳方法是什么,同时对于不支持它的设备优雅地降级?我的目标是 Android 1.5 以上。

I would like to handle pinch events in my Android application to zoom in and out.

I believe Android 2.0 has multi-touch functionality, and heard that Android 1.6 might or might not support it depending of the device.

What's the best way to detect pinch events, while degrading gracefully for devices that don't support it? I'm targeting Android 1.5 upwards.

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

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

发布评论

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

评论(2

ヅ她的身影、若隐若现 2024-09-04 17:06:46

Ed Burnette(Hello Android 作者)关于多点触控(包括捏合缩放)的精彩文章可以在这里找到:http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2/1747

这是 Android 开发人员博客上的一篇文章,介绍如何在支持新 API 的设备上利用新 API 的功能,同时继续优雅地支持旧设备。
http://android-developers.blogspot.com/2009 /04/backward-compatibility-for-android.html

A great article by Ed Burnette (Hello Android Author) on multi touch (including pinch zoom) can be found here: http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2/1747

Here's an article on the Android developer blog about taking advantage of capability of the newer APIs on devices that support them, while gracefully continuing to support older devices.
http://android-developers.blogspot.com/2009/04/backward-compatibility-for-android.html

殊姿 2024-09-04 17:06:46

Android 1.6 不支持多点触控,Android 2.0 及更高版本支持多点触控,这意味着您需要有不同的 OnTouchHandler,您可以根据检测到的 Android 版本进行交换。有关如何实现捏缩放的更多信息,请查看 此线程

Android 1.6 does not support multi-touch, Android 2.0 and above does, that means that you would need to have different OnTouchHandlers that you can swap in based on the version of Android you detect. For more information about how to implement the pinch-zoom, have a look at this thread.

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