在Android的按钮图像大小按钮、图像、大小、Android

2023-09-13 00:49:47 作者:风驰

我已经把图片作为按钮的背景。但我不知道我应该在Photoshop中创建什么尺寸的图像对所有的三个文件夹绘制,华电国际,绘制,LDPI,并绘制-MDPI怎么样?

I have put image as background of button. but I don't know at what size of images should I create in Photoshop for all three folders drawable-hdpi,drawable-ldpi, and drawable-mdpi?

感谢你。

推荐答案

如果您BUTTOM图像是素色的背景,如果它可以是一个可拉伸的图像,然后使用创建位图 9-Patch工具。

If your buttom image is Plain-colored background and if it can be a Stretchable image then Create a bitmap using 9-Patch Tool.

否则,请参阅 备用可绘制 在Android开发者网站部分:

要为不同密度的替代位图可绘制您   应遵循的 3:4:6:8比例的四个广义之比   密度。例如,如果你有一个位图绘制这就是48×48   对于中等密度的屏幕(为一个启动器图标的大小),所有像素   不同的尺寸应该是:

To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8 scaling ratio between the four generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screen (the size for a launcher icon), all the different sizes should be:

36x36的低密度

48×48的中密度

的72x72的高密度

96×96的超高密度

96x96 for extra high-density