如何检测,如果屏幕是电容或电阻的Andr​​oid设备? [英] how to detect if the screen is capacitive or resistive in an Android device?

查看:146
本文介绍了如何检测,如果屏幕是电容或电阻的Andr​​oid设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了将表现略有不同的屏幕类型的应用程序。有什么方法来检测呢?

I am developing an application that will behave slightly different depending on the type of screen. Is there any way to detect it?

推荐答案

我有一个小窍门做,而是需要一个画布。 只是检测一个motionEvent如果

I have a small trick to do it but requires a canvas. Just detecting in a motionEvent if

event.get pressure()> 0,则是电容; event.getSize()> 0,则是电阻

event.getPressure() > 0 then is capacitive ; event.getSize() > 0 then is resistive

问题是我不想使用画布只是为了检测它:(

the problem is I dont want to use a canvas just for detecting it :(

这篇关于如何检测,如果屏幕是电容或电阻的Andr​​oid设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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