Android: drawable resolutions

前端 未结 6 1552
温柔的废话
温柔的废话 2021-02-08 12:06

I\'ve been through this post (and others) as well as through the documentation about supporting different screen resolutions in Android, but I couldn\'t find a clear answer to a

6条回答
  •  有刺的猬
    2021-02-08 12:14

    For what it is worth I found the image handling of Android to be tedious and unreliable. The concept of including different size images for different screens will result in large application files bloated with images. There are already screens that don't fit in the standard resolution ranges. I have found it is best not to let android handle the scaling, it seems to create a base image for the smallest screen you target and then scale it up resulting in ordinary looking images on large screens. This happens even if you made the image specifically for the large screen. My solution that seems to work on everything from a 2" samsung phone to a Sony Tablet is to create images at high resolution and use Bitmap.createScaledBitmap() to get the size I need.

    caveat: I am new to Android and have lots to learn.

提交回复
热议问题