android上准确获取屏幕尺寸的方法

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">&lt;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" /&gt;</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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值