处理何时按下按钮,何时松开按钮

来源:互联网 发布:英雄无敌5 宝物数据 编辑:程序博客网 时间:2024/05/22 03:47
imageButton.setOnTouchListener(new OnTouchListener(){              @Override             public boolean onTouch(View v, MotionEvent event) {                 if(event.getAction() == MotionEvent.ACTION_DOWN){                     //按下                                                         }else if(event.getAction() == MotionEvent.ACTION_UP){                     //抬起                                                       }                       return false;              }           });  

原创粉丝点击