Android 应用开发: APP Resource && ImageView



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: 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值