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

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

문제

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.

도움이 되었습니까?

해결책

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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top