Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用代码获取屏幕尺寸,如:
小或正常或大或超大
谢谢
编辑:这不是我想要的尺寸,我想要定义它是小、正常、大还是 xlarge 的东西,就像你在布局文件夹中拥有的那样,/res/layout-normal 或 /res/layout-xlarge
使用DisplayMetrics类。这是给你的一个很好的样本。