您的位置:首页 > 移动开发

Android 应用开发: APP Resource && ImageView

2016-11-15 11:32 363 查看
PartI: APP Resource:

1, APP 资源的类型:

NameFolderDescription
Property AnimationsanimatorXML files that define property animations.
Tween AnimationsanimXML files that define tween animations.
DrawablesdrawableBitmap files or XML files that
act as graphics
LayoutlayoutXML files that define a user interface layout
MenumenuXML files that define menus or action bar items
ValuesvaluesXML files with values such as strings, integers, and colors.
 两种动画:property  Animations 和 Tweeen animations 
Drawables ------------ 如果里面有XML文件,也主要是用于描述background等graphic图像为主

2,在JAVA代码中访问资源文件

Part II :资源文件:

1,分辨率匹配:



2,多屏像素密度匹配:



DensityDPIExample DeviceScalePixels
ldpi120Galaxy Y0.75x1dp = 0.75px
mdpi160Galaxy Tab1.0x1dp = 1px
hdpi240Galaxy S II1.5x1dp = 1.5px
xhdpi320Nexus 42.0x1dp = 2px
xxhdpi480Nexus 53.0x1dp = 3px
xxxhdpi640Nexus 64.0x1dp = 4px
像素密度匹配: 如果一张图片以mdpi的分辨率为100 x 100; 那么 hdpi的分辨率就要设置为150x150;

xhdpi调整为200x200,ldpi调整为75x75依次类推。
DPI: 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: