Android学习笔记-屏幕适配

  1. layout ,drawable 根据文件夹的命名系统查找资源。类似:
    layout/
    用于横向,layout-port/
    用于纵向

  2. 资源大小

    res/
    drawable-xhdpi/
         awesomeimage.png
     drawable-hdpi/
         awesomeimage.png
     drawable-mdpi/
         awesomeimage.png
     drawable-ldpi/
         awesomeimage.png
    

各个屏幕的比例比

xhdpi: 2.0
hdpi: 1.5
mdpi: 1.0 (baseline)  
ldpi: 0.75

ldpi (low) ~120dpi
mdpi (medium) ~160dpi
hdpi (high) ~240dpi
xhdpi (extra-high) ~320dpi
xxhdpi (extra-extra-high) ~480dpi
xxxhdpi (extra-extra-extra-high) ~640dpi

xlarge* screens are at least 960dp x 720dp
large* screens are at least 640dp x 480dp
normal* screens are at least 470dp x 320dp
small* screens are at least 426dp x 320dp

你可能感兴趣的:(Android学习笔记-屏幕适配)