android-studio - Android 不同的Drawable 文件夹对图片做的什么处理
黄舟
黄舟 2017-04-18 09:12:58
0
2
815

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

这个是

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

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
巴扎黑

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

迷茫

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!