Using same drawable image in two different folder

2019-09-19 13:21发布

问题:

I want to keep same images in two folders drawable-large-xhdpi and drawable-xlarge-hdpi. avoiding duplication of images reduces memory How? I am having images of 1920x1080 resolution Any usefull answer i am very thankful to all. (example: if the image is half of screen width , it should be half of the screen in all tablets)

回答1:

If you want to keep exactly the same image in drawable-large-xhdpi and drawable-xlarge-hdpi then you apparently do not really understand what these xhdpi and hdpi selectors stands for, as image cannot be hdpi and xhdpi at the same time, so your approach is basically wrong. Please read this article to get the picture of how Android manages assets: http://developer.android.com/guide/practices/screens_support.html

EDIT

Here another article that you need to read to understand how Android picks assets and how it falls back in case of lack of such: http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch that will help you organize your assets correctly