正在写一个连连看,需要onTouch获得点击坐标数据,于是使用了onTouch事件,然而使用后发现多次执行了onTouch事件。Android onTouch事件记录

原因:onTouch事件分为了ACTION_DOWN(按下)、ACTION_UP(放开)等等状态,所以会多次调用。

来个switch就好了。

Android onTouch事件记录

 

相关文章:

  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案