【发布时间】:2013-07-12 09:46:21
【问题描述】:
我知道 android 有 4 种标准屏幕尺寸:
xlarge,large, normal and small
如何从这4种尺寸中知道运行设备的屏幕尺寸有哪些?
【问题讨论】:
标签: android screen-size
我知道 android 有 4 种标准屏幕尺寸:
xlarge,large, normal and small
如何从这4种尺寸中知道运行设备的屏幕尺寸有哪些?
【问题讨论】:
标签: android screen-size
int screenSize = getResources().getConfiguration().screenLayout &
Configuration.SCREENLAYOUT_SIZE_MASK;
switch(screenSize) {
case Configuration.SCREENLAYOUT_SIZE_LARGE:
Toast.makeText(this, "Large screen",Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_NORMAL:
Toast.makeText(this, "Normal screen",Toast.LENGTH_LONG).show();
break;
case Configuration.SCREENLAYOUT_SIZE_SMALL:
Toast.makeText(this, "Small screen",Toast.LENGTH_LONG).show();
break;
default:
Toast.makeText(this, "Screen size is neither large, normal or small" , Toast.LENGTH_LONG).show();
}
【讨论】: