Share Coding

Tutorials, Problems, Stuffs …

Drawable localization

test

 

Open a folder with name ‘drawable-en’ when the local setting is ‘en’.
My default language is ‘zh’, so the image with chines word store at ‘drawable’ folder.
At the same time, we should have ‘values’ and ‘values-en’ folders.

How it works?

By default, the image in ‘drawable’ folder will choose by system.
Image should have the same file name in all folders.

How about folder ‘drawable-hdpi’? Should I place image in it?

The answer is no.
The ‘dpi’ folder is working for size problem, not the language problem.
If you don’t place image in the ‘dpi’ folder, it works perfectly.

A suggestion:
Small image (Button image) with words place in drawable, drawable-en.
Background image place at dpi folders.

Is it possible to use drawable-en-mdpi, drawable-en-hdpi for localization with different resolutions?

Yes, but not suggested. Your apk file size will become huge.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: