我写了下面的代码,我无法理解它有什么问题。它没有捕获MotionEvent.ACTION_POINTER_DOWN。
public boolean onTouch(View vk,MotionEvent me)
{
if(me.getActionMasked()==MotionEvent.ACTION_DOWN)
{
start_pinch=1;
tv.setBackgroundResource(R.drawable.shape);
}
if(me.getActionMasked()==MotionEvent.ACTION_POINTER_DOWN)
{
Toast.makeText(MainActivity.this,""+start_pinch,
Toast.LENGTH_SHORT).show();
}
return true;
}
答案 0 :(得分:0)
要求在方法public boolean onTouch(View vk,MotionEvent me){
if(me.getActionMasked()==MotionEvent.ACTION_DOWN){
start_pinch=1;
tv.setBackgroundResource(R.drawable.shape);
return true;
}
if(me.getActionMasked()==MotionEvent.ACTION_POINTER_DOWN){
Toast.makeText(MainActivity.this,""+start_pinch,
Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
样品:
{{1}}