k歌之王: 考虑到ANDROID手机屏幕尺寸大小不一, 程序适配显得很重要。 特意转一篇网上的文章。
有些时候,我们需要获取Android手机或Pad的屏幕的物理尺寸,以便于界面的设计或是其他功能的实现。下面就介绍讲一讲如何获取屏幕的物理尺寸:
<wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">从网上找过不少资料,发现获取屏幕尺寸并不是很复杂的编程操作,下面的代码即可获取屏幕的尺寸。</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">在一个Activity的onCreate方法中,写入如下代码:</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">DisplayMetrics metric = new DisplayMetrics();</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">getWindowManager().getDefaultDisplay().getMetrics(metric);</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">int width = metric.widthPixels;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">// 屏幕宽度(像素)</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">int height = metric.heightPixels;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">// 屏幕高度(像素)</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">float density= metric.density;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">// 屏幕密度(0.75 / 1.0 / 1.5)</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">int densityDpi = metric.densityDpi;</span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">// 屏幕密度DPI(120 / 160 / 240)</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">但是,需要注意的是,在一个低密度的小屏手机上,仅靠上面的代码是不能获取正确的尺寸的。比如说,一部240x320像素的低密度手机,如果运行上述代码,获取到的屏幕尺寸是320x427。因此,研究之后发现,若没有设定多分辨率支持的话,Android系统会将240x320的低密度(120)尺寸转换为中等密度(160)对应的尺寸,这样的话就大大影响了程序的编码。所以,需要在工程的AndroidManifest.xml文件中,加入supports-screens节点,具体的内容如下:</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><supports-screens</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">android:smallScreens="true"</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">android:normalScreens="true"</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">android:largeScreens="true"</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">android:resizeable="true"</span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">android:anyDensity="true" /></span><br style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"></span><wbr style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px"><span style="color:rgb(50,62,50); font-family:simsun; font-size:14px; line-height:22px">这样的话,当前的Android程序就支持了多种分辨率,那么就可以得到正确的物理尺寸了。</span><br></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>