1

I would like to put an image on a Button with some text, like:

--------------
[image] [text]
--------------

We can do this with Button, and specify the left Drawable, but it uses the "intrinsic" size of the drawable. If I understand correctly, this won't work across different density devices. If my image is 32x32 pixels, it will look really small on hdpi devices. Is there any way to specify the width and height of the drawable, in dp, so that it will take the same amount of space on different devices?

4

1 回答 1

2

这是对的。您需要图像的 hdpi、mdpi 和 ldpi 版本,只需将它们放在适当的可绘制文件夹中,操作系统将处理其余的。

如果您需要更多信息,这里是资源方案的链接。

于 2010-12-22T01:58:49.300 回答