Drawable V21 vs V24 vs自定义文件夹,用于hdpi,mdpi,xhdpi等.我应该将图像放置在哪个文件夹中以获得多设备支持? [英] Drawable V21 vs V24 vs custom folders for hdpi,mdpi,xhdpi etc.. ? In which folder should I put my images for multi-device support?

查看:200
本文介绍了Drawable V21 vs V24 vs自定义文件夹,用于hdpi,mdpi,xhdpi等.我应该将图像放置在哪个文件夹中以获得多设备支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个android应用程序,其中的主页包含8个ImageViews,它们充当用户的菜单选项,因此我应将这些ImageViews的多密度图像放在自定义可绘制文件夹(ldpi,mdpi,hdpi,xhdpi,xxhdpi,xxxhpi)或drawableV21或drawableV24吗?

I have an android application, In which home page comprises of 8 ImageViews, they act as menu options for users, So where should I put the multi-density images for these ImageViews in custom drawable folders(ldpi,mdpi,hdpi,xhdpi,xxhdpi,xxxhpi) or drawableV21 or drawableV24 ?

推荐答案

它会根据您的需要进行更改.对于图像,可以将它们设计为最高分辨率,然后将其放在xxxhdpi文件夹中.Android会自动降低其他设备的分辨率.此外,您可以为不同的分辨率放置不同的可绘制对象.但是它们应该具有相同的名称.

It changes due to your need. For images, you can design them for the highest resolution and put them in xxxhdpi folder. Android will automatically downscale resolution for other devices. Also, you can put different drawables for different resolutions. But they should have the same name.

对于drawableV21,drawable24取决于您要运行应用程序的版本.如果您放置了drawable v24,但未在drawableV21文件夹中放置任何具有相同名称的东西.您的应用将在Android API24以下崩溃.

For drawableV21, drawable24 depends on the version you want to run your app. if you put a drawable v24 and not put anything with the same name in the drawableV21 folder. Your app will crash below Android API24.

因此,您应该使用此文件夹为不同的API版本和分辨率显示不同的可绘制对象或其他资源.

So you should use this folder to show different drawable or other assets for different API Versions and resolutions.

这篇关于Drawable V21 vs V24 vs自定义文件夹,用于hdpi,mdpi,xhdpi等.我应该将图像放置在哪个文件夹中以获得多设备支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆