PartI: APP Resource:
1, APP 资源的类型:
Name | Folder | Description |
---|---|---|
Property Animations | animator | XML files that define property animations. |
Tween Animations | anim | XML files that define tween animations. |
Drawables | drawable | Bitmap files or XML files that act as graphics |
Layout | layout | XML files that define a user interface layout |
Menu | menu | XML files that define menus or action bar items |
Values | values | XML files with values such as strings, integers, and colors. |
- 两种动画:property Animations 和 Tweeen animations
- Drawables ------------ 如果里面有XML文件,也主要是用于描述background等graphic图像为主
2,在JAVA代码中访问资源文件
Part II :资源文件:
1,分辨率匹配:
2,多屏像素密度匹配:
Density | DPI | Example Device | Scale | Pixels |
---|---|---|---|---|
ldpi | 120 | Galaxy Y | 0.75x | 1dp = 0.75px |
mdpi | 160 | Galaxy Tab | 1.0x | 1dp = 1px |
hdpi | 240 | Galaxy S II | 1.5x | 1dp = 1.5px |
xhdpi | 320 | Nexus 4 | 2.0x | 1dp = 2px |
xxhdpi | 480 | Nexus 5 | 3.0x | 1dp = 3px |
xxxhdpi | 640 | Nexus 6 | 4.0x | 1dp = 4px |
像素密度匹配: 如果一张图片以mdpi的分辨率为100 x 100; 那么 hdpi的分辨率就要设置为150x150;
xhdpi调整为200x200,ldpi调整为75x75依次类推。
DPI: