Drawable V21 vs V24 vs custom folders for hdpi,mdpi,xhdpi etc.. ? In which folder should I put my images for multi-device support?

喜欢而已 提交于 2020-12-16 02:52:18

问题


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 ?


回答1:


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

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

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



来源:https://stackoverflow.com/questions/58363128/drawable-v21-vs-v24-vs-custom-folders-for-hdpi-mdpi-xhdpi-etc-in-which-folde

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!