the number of physical pixels contained in a one inch area of a given device’s display screen
low or LDPI, medium or MDPI, tv or TVDPI, high or HDPI, extra high or XHDPI and XXHDPI
in manifest: <supports-screens android:largeScreens="true" android:xlargeScreens="true" />
使用这个格式,进行屏幕判断,使用不同xml文件。
720 DIP, then you would use this qualifier to create the layout resource folder named /res/layout-sw720dp to hold your user interface layout definition XML files for your app’s Activities
w#dp (example: w480dp):横竖屏 切换 使用不同布局(根据可视宽度)
不用同时关注方向和屏幕大小:This is due to the fact that even on the larger tablet devices, you often don’t want to use the same multiple pane UI layout design for the portrait orientation as you do for the landscape orientation. With the width screen configuration modifier, you can use something like w640dp to specify a 640 DIP minimum available screen area width for your layout, instead of having to implement both the screen size qualifier and orientation qualifier.
h#dp (example: h600dp)
no density-matching assets can be located in your /res/drawable folders, Android will use your default assets, which are kept in the /res/drawable folder; if none are found there, Android will use the MDPI density resources in the /res/drawable-mdpi folder, and will then scale these up or down as needed to match the current screen size and density.
I keep only XML definitions for things like animations and transitions in this /res/drawable folder, and then keep all of my pixel-based digital imaging assets in those various density-specific /res/drawable-dpi folders.
no scale
package : android.util
display physical size in both the X and Y dimensions
DisplayMetrics currentDeviceDisplayMetrics = new DisplayMetrics(); getWindowManager().getDefaultDisplay().getMetrics(currentDeviceDisplayMetrics);
《Pro Android Graphics》读书笔记之第五节,布布扣,bubuko.com
《Pro Android Graphics》读书笔记之第五节
原文:http://blog.csdn.net/lilu_leo/article/details/26863179