android开发文档之onTouch()

onTouch()- This returns a boolean to indicate whether your listener consumes this event. The important thing is that this event can have multiple actions that follow each other. So, if you returnfalsewhen the down action event is received, you indicate that you have not consumed the event and are also not interested in subsequent actions from this event. Thus, you will not be called for any other actions within the event, such as a finger gesture, or the eventual up action event.


它将返回一个布尔类型的值来表明你的监听器是否消费了这个事件。重要的是这个事件可以有多个相关的动作。因此,如果在按下动作事件被接收时你返回false,这就表明你没有消费此事件而且对此事件后来的一些列动作都不感兴趣。因此,所有在事件中的其他的动作也不会被调用,例如:手指手势,或最后的抬起动作事件。

总结:这段文字的大意是说,如果在down action 事件被接收时你返回了false,那么所有依赖于down action的动作都不会被执行。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值