在Android中如何获得怎样手指多接触屏幕?如何获得、手指、屏幕、Android

2023-09-07 11:33:36 作者:ちょうあい (宠爱)

在自定义视图如何将有可能获得多少手指触摸屏幕。换句话说,要获得,如果用户使用他的手指的尖端或更大的区域。然后能够得到矩形的各层面。

In a custom view how would it be possible to get how much of a finger touched the screen. In other words, to get if the user used the tip of his finger or a larger area. And then to be able to get each dimension of the rectangle.

推荐答案

event.getPointerCount()方法调用给你触摸的数量

event.getPointerCount() method call gives you number of touch

样品code

@Override
public boolean onTouchEvent(final MotionEvent event)
{
    System.out.println("Touch Count ="+event.getPointerCount());

    return true;
}