getPressure always returning 1.0

喜欢而已 提交于 2019-12-31 04:46:07

问题


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;

    }

回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/12414491/getpressure-always-returning-1-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!