San*_*l V 1 android ontouchlistener touch-event
我正在使用onTouchListener进行布局。我想在布局之外点击。我为布局设置了onTouchListetener。但是运动事件始终显示ACTION_DOWN。即使我触摸视图外,它也没有显示ACTION_OUTSIDE。谁能帮助我找出为什么它没有显示恒定的ACTION_OUTSIDE。这是我正在使用的代码
Layout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Log.i("action",event.getAction()+"");
if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
Toast.makeText(getApplicationContext(), "check", Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1370 次 |
| 最近记录: |