[英]Sizes for drawable: LDPI, MDPI, HDPI, XHDPI, XXHDPI, XXXHDPI?
建议可绘制的尺寸是什么:LDPI,MDPI,HDPI,XHDPI,XXHDPI,XXXHDPI或i可以对所有尺寸使用相同尺寸的图像,并以编程方式更改它,例如更改宽度和高度?
Inside Android Studio, if you right click on the res folder, you can select New > Image Asset which will create properly sized drawables for those dpi bucket folders. 在Android Studio中,如果右键单击res文件夹,则可以选择“新建”>“图像资产”,这将为那些dpi存储桶文件夹创建适当大小的可绘制对象。
Optionally, you can also use a website like this one: http://romannurik.github.io/AndroidAssetStudio/index.html 您也可以选择使用类似这样的网站: http : //romannurik.github.io/AndroidAssetStudio/index.html
You can also programmatically change width/height, but this is heavily discouraged due to how disgusting a smaller image looks when it's stretched large. 您还可以通过编程方式更改宽度/高度,但是由于较小的图像在拉伸时会显得令人恶心,因此不建议这样做。 Only use this programmatic solution if you use vector images. 如果使用矢量图像,则仅使用此编程解决方案。
The relationship between the various proportions is as follows: 各个比例之间的关系如下:
LDPI - 0.75x
MDPI - 1.0x (original size)
HDPI - 1.5x
XHDPI - 2.0x
XXHDPI - 3.0x
XXXHDPI - 4.0x
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.