有什么方法来确定当前的设备,如小,正常,大,XLARGE的屏幕尺寸的范畴?
Is there any way to determine the category of screen size of the current device, such as small, normal, large, xlarge?
不是密度,但屏幕尺寸。
Not the density, but the screen size.
您可以使用Configuration.screenLayout位掩码。
You can use the Configuration.screenLayout
bitmask.
例如:
if ((getResources().getConfiguration().screenLayout &
Configuration.SCREENLAYOUT_SIZE_MASK) ==
Configuration.SCREENLAYOUT_SIZE_LARGE) {
// on a large screen device ...
}
上一篇:开发跨平台移动应用平台