简体   繁体   中英

Support all android screen size

I'm have tired to support all android , but I want to ask about supporting all screen size on android

I have 4 layout folders :

layout
layout-ldpi  2.7 inch = 240*320 
layout-mdpi  3.2 = 320*480
layout-hdpi  3.7 = 480*800 
layout-xhdpi 800*1280 
layout-xxhdpi 5 inch 1080*1920 

Is this setting in each layout support all devices or maybe I have missed some thing ?

Note : I have reviewed android site Android Developers many time .

I'm not sure what you want to achieve. You should split your resoures in two groups. One with density (folder called drawable) which contains images in different sizes for different display resolutions. The second one with layout (called layout) is for supporting different UI layout of each screen. Typically for tablet or mobile phones. So you should have forlder

  • drawable-ldpi, mdpi, etc. - here will be your png files
  • layout-"default",sw360, sw600, sw720 ("large" mobile, small 7" tablet, large 10" tablet). If your are targeting below 3.2, you can't you sw (smallest-width) but use older small, medium, large, xlarge screen size. - here will be your *.xml layout files
    Don't mix up layout and density resource qualifiers together. See more here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM