OnTouchListener和OnClickListener的区别 [英] Difference between OnTouchListener and OnClickListener

查看:285
本文介绍了OnTouchListener和OnClickListener的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做了一个应用程序implemements视图OnTouchListener。当我上传到了市场,我得到以下信息:

I made an app which implemements a View OnTouchListener. When I uploaded it to the Market, I get the following message:

This apk requests 1 features that will be used for Android Market filtering
android.hardware.touchscreen

我真的不需要触摸屏本身。您还可以点击的说法,这将是罚款。而是采用了OnTouchListener如果我用了OnClickListener,将这一要求离开?

I really don't need a touchscreen per se. You could also "click" the view and this would be fine. If instead of using the OnTouchListener, I used the OnClickListener, would this requirement go away?

没有多大比例的Andr​​oid设备的触摸屏?如果此更新从OnTouchListener到OnClickListener成为新的潜在用户方面有所作为?

What percentage of Android devices do not have a touch screen? Should this update from OnTouchListener to OnClickListener be something worthwhile in terms of new potential users?

谢谢!

推荐答案

OnTouchListener是更精细的控制比OnClickListener。如果你真的关心的是点击 - 也就是说,对组合下的触摸/向上触摸/不拖 - 再使用OnClickListener,这是它的目的。

OnTouchListener is for more fine-grained control than OnClickListener. If what you really care about is clicks -- i.e., the combination of of down-touch/up-touch/no-drag -- then use OnClickListener, that's its purpose.

这篇关于OnTouchListener和OnClickListener的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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