Android: Milestone and Galaxy have same resolution / dpi qualifiers for drawable, how to differentiate?

StackOverflow https://stackoverflow.com/questions/7489389

Question

I'm developing an application that I'm testing on both the Motorola Milestone and the Galaxy Tab 10.1. My issue is that I'm trying to get my icons to scale properly by attaching qualifiers after the drawable folder name, and want the Milestone to use one set of icons, and the Tab to use another, but haven't found a unique combination to target either phone.

i.e. if I set my drawable folder to drawable-hdpi the Milestone and Tab both use the images in that folder.

Était-ce utile?

La solution

Try the screen size modifiers. e.g. have two drawable directories:

drawable-normal
drawable-xlarge

See Table 2 in the documentation for more qualifiers that you can try.

Autres conseils

drawable-hdpi will target the Milestone (DPI = 240)

drawable-mdpi will target the Galaxy Tab 10.1 (DPI = 149)

You are mistaken that the Tab and Milestone are in the same DPI bucket.

For more information on how tablets and phones can be handled with res folders, see this android developers blog post.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top