简体   繁体   中英

Android: how to place same image with different resoultion in drawable-hdpi

I have samsung galaxy 7" tab(hdpi) and kindle fire 7" hd device. both having different screen resolutions(samsung galaxy - 1024*600 and kindle fire hd - 1280*800). both are hdpi devices, so naturally picking resources from drawable-hdpi.

Now i want following thing to do:

one image say Img1.png is created in 2 different size and same name

Eg: Img1.png(say 72*72px) and Img1.png(say 78*78px)

Now how to place these images under drawable-hdpi folder so that 72*72 image will picked up by samsung tab and 78*78 by kindle fire.

Is there any naming convention followed for images or drawable folder so that android can identify images for hdpi devices with different screen sizes,

Please please help me for the same.

Thanks in advance,

Ketan Bhangale

Images for hdpi are selected automatically when the app detects the screen to be a hdpi one. You just have to place the images of same name but different sizes in respective folders.

您可以将较大的文件放在sw600dp文件夹中(如有必要,可以调整值)。

Actually there is a naming convention. According to how you name your resources folder android selects where to pick the graphics from. Here you can find a full list of all the different qualifiers that are supported.

For example, drawable-en-rUS-land applies to US-English devices in landscape orientation.

However I am not sure that there is any qualifier that can distinguish the 2 devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM