问题
I am newbie as far as android application development is considered.
I am little bit confused about drawable folders.
In the tutorials available on the android developer site they have mentioned about the drawable folder. But when I create android 2.3.3 application I see three folders drawable-hdpi
, drawable-mdpi
and drawable-ldpi
.
I know that this for screen resolutions. If I have an image as a resource I have to create equivalent three images with different sizes and put these images into these three folders.
But for example, I am working on a localization (German) with images. Should I create folder drawable-hdpi-de-rDE
similarly drawable-mdpi-de-rDE
and drawable-ldpi-de-rDE
or should drawable-de-rDE
be sufficient?
If drawable-de-rDE
is sufficient what will happen if it is run in mdpi or ldpi?
Please clear my doubts regarding this.
Thanks
Pankaj
回答1:
Should i create folder drawable-hdpi-de-rDE similarly drawable-mdpi-de-rDE & drawable-ldpi-de-rDE
If you want to make your pictures (at the right sizes) yourself, yes, you'll have to create directories that are specific to both the culture and pixel density. However, the culture should come before the dpi, or the project will not compile. For example, the following would compile correctly:
drawable-de-rDE-hdpi
drawable-de-rDE-mdpi
drawable-de-rDE-ldpi
should drawable-de-rDE will be sufficient?
If you don't feel the need to draw your pictures at the right scale yourself, that should work : android will scale the images to the right size, as needed.
But note that you might get better graphics doing that scaling yourself -- and, instead of just scale up/down, you could re-think your images a little bit, so they fit better in different sizes.
回答2:
http://developer.android.com/guide/topics/resources/localization.html
来源:https://stackoverflow.com/questions/5537208/unable-to-understand-the-drawable-structure-inside-res-folder