[英]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. 我有三星银河7“标签(hdpi)和点燃火7”高清设备。 both having different screen resolutions(samsung galaxy - 1024*600 and kindle fire hd - 1280*800).
两者都具有不同的屏幕分辨率(三星银河-1024 * 600和Kindle Fire HD-1280 * 800)。 both are hdpi devices, so naturally picking resources from drawable-hdpi.
两者都是hdpi设备,因此很自然地从drawable-hdpi中选择资源。
Now i want following thing to do: 现在我想做以下事情:
one image say Img1.png is created in 2 different size and same name 一张图片说Img1.png是用2种不同的大小和相同的名称创建的
Eg: Img1.png(say 72*72px) and Img1.png(say 78*78px) 例如:Img1.png(例如72 * 72px)和Img1.png(例如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. 现在,如何将这些图像放置在drawable-hdpi文件夹下,以使72 * 72的图像被“三星”选项卡拾取,而78 * 78的“点燃”火焰。
Is there any naming convention followed for images or drawable folder so that android can identify images for hdpi devices with different screen sizes, 图像或可绘制文件夹是否遵循任何命名约定,以便android可以识别具有不同屏幕尺寸的hdpi设备的图像,
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. 当应用检测到屏幕为hdpi时,将自动选择hdpi的图像。 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.
根据您如何命名资源文件夹,android会选择从中选择图形的位置。 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.
例如,drawable-en-rUS-land适用于横向的美式英语设备。
However I am not sure that there is any qualifier that can distinguish the 2 devices. 但是,我不确定是否有任何区分两个设备的限定符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.