WEB开发网
开发学院手机开发Android 开发 onClick与onTouch并存触发的问题 阅读

onClick与onTouch并存触发的问题

 2012-08-24 16:16:07 来源:WEB开发网   
核心提示:【1】onClick与onTouch的官方介绍:onClick()From View.OnClickListener. This is called when the user either touches the item (when in touch mode), or focuses upon the item

【1】onClick与onTouch的官方介绍:
onClick()
From View.OnClickListener. This is called when the user either touches the item (when in touch mode), or focuses upon the item with the navigation-keys or trackball and presses the suitable "enter" key or presses down on the trackball.
可以看到这个onClick要么是在touchmode的情况下会被回调,要么是在非touchmode的情况下,当focus到的时候被回调。
onTouch()
From View.OnTouchListener. This is called when the user performs an action qualified as a touch event, including a press, a release, or any movement gesture on the screen (within the bounds of the item).
那么onTouch就是类似press,release或者其他类似在屏幕上的移动。

上一页  1 2 

Tags:onClick onTouch 并存

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接