Home  >  Q&A  >  body text

android-studio - Android 不同的Drawable 文件夹对图片做的什么处理

我用一张1920*1080的图片,放到drawable-hdpi文件夹下,然后在IamgeView中加载,android:scaleType="center"加载原图,不进行缩放,在1080p的屏幕上,但是显示不全,但是放到drawable-xxdpi文件夹中就显示正常,正好充满屏幕。
这个是放到hdpi中的

这个是

之前就知道系统会依次寻找,但是为什么会改变原图呢?

黄舟黄舟2762 days ago852

reply all(2)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 09:14:58

    Your 1080p picture is too big for hdpi. If you specify the directory, the system will load the corresponding size. If you specify hdpi here, then the resolution it loads should be one level smaller than 720p (720p corresponds to is xhdpi), if your image is larger, it can only load part of it because you specified the size (directory).

    It is also recommended that you read this article. Images should be placed in the corresponding resolution file directory, which also has an impact on memory.
    Research and analysis on the relationship between image size, memory usage and drawable folders in Android

    reply
    0
  • 迷茫

    迷茫2017-04-18 09:14:58

    Use hpdi(480800) to center the 10801920 picture,
    Read this blog post to understand the ImageView.ScaleType setting diagram
    The most comprehensive and easy-to-understand Android screen adaptation solution

    reply
    0
  • Cancelreply