Android: Multiple Image Density support - scale height width and dpi?

后端 未结 4 999
我寻月下人不归
我寻月下人不归 2021-02-20 00:17

I have an android app that I\'m trying to add support for different densities, screen sizes, etc. I\'ve developed the app on the simulator with the HVGA support and used all ic

4条回答
  •  情深已故
    2021-02-20 01:13

    I recently solved this problem by generating many PNGs of different sizes from a SVG vector image. These are the ratios I used for screen pixel densities and screen sizes:

    • ldpi:mdpi:hdpi:xhdpi:xxhdpi <-> 3:4:6:8:12
    • sw320dp:sw360dp:sw480d:sw600dp:sw720dp <-> 8:9:12:15:18

    Putting these two together can give a 5 by 5 table of image size ratios that you need in make your image resources look great on most Android devices' screens. Of course, the downside is that many images will be generated, and the size of your APK will grow.

    Please see http://aleakymemory.blogspot.com/2013/11/a-different-look-at-managing-android.html for the table of image size ratios.

提交回复
热议问题