在Android中如何获得怎样手指多接触屏幕? [英] In Android how to get how much of a finger touched the screen?

查看:130
本文介绍了在Android中如何获得怎样手指多接触屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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;
}

这篇关于在Android中如何获得怎样手指多接触屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆