我如何获得广义屏幕大小?广义、如何获得、屏幕、大小

2023-09-07 21:58:31 作者:▍夏殇

http://developer.android.com/guide/practices/screens_support.html声明:

术语和概念

屏幕大小的实际物理尺寸,  作为屏幕的对角线测量。对于  简单起见,Android将所有实际  屏幕尺寸为广义  大小:小,中,大,和额外的  大的。

Screen size Actual physical size, measured as the screen's diagonal. For simplicity, Android groups all actual screen sizes into four generalized sizes: small, normal, large, and extra large.

我如何编程获取设备屏幕的大小普遍?该方法或属性我要找会返回之一:小,中,大,超大。 (或者可以映射到那些常量/枚举)

How do I programmatically get the generalized size of the device screen? The method or property I am looking for will return one of: small, normal, large, and extra large. (or const/enums that can be mapped to those)

感谢。

-mz

推荐答案

使用screenLayout在配置对象。