getPressure always returning 1.0

2020-04-18 07:47发布

Does anyone have any idea why getPressure() returns always 1.0?

Here is my code:

@Override
    public boolean onTouchEvent(MotionEvent event) {
        super.onTouchEvent(event);

        System.out.println(event.getPressure());

        return true;

    }

2条回答
不美不萌又怎样
2楼-- · 2020-04-18 08:28

https://groups.google.com/forum/#!topic/android-developers/10pF8EUEuy0 Here's an answer about how getPressure and getSize() work in Android, I think this would help

查看更多
走好不送
3楼-- · 2020-04-18 08:31

Does anyone have any idea why getPressure() returns always 1.0?

The typical touchscreen / input device has no way to measure pressure. You either don't press and get no touch event or you press and get a touch event with value 1.

查看更多
登录 后发表回答