Android 开发者您好,
我想知道如何选择drawable的尺寸;例如,我想在我的应用程序中插入一张图像,该图像应插入到 xxhdpi、xhdpi、hdpi、mdpi 和 ldpi 中,其尺寸(像素)是多少?
我在 GitHub 上分析了许多 Android 应用程序,它们使用随机图像大小(像素)来实现不同的密度。
最佳答案
To create alternative bitmap drawables for different densities, you should follow the 3:4:6:8:12:16 scaling ratio between the six generalized densities. For example, if you have a bitmap drawable that's 48x48 pixels for medium-density screens, all the different sizes should be:
- 36x36 (0.75x) for low-density
- 48x48 (1.0x baseline) for medium-density
- 72x72 (1.5x) for high-density
- 96x96 (2.0x) for extra-high-density
- 144x144 (3.0x) for extra-extra-high-density
- 192x192 (4.0x) for extra-extra-extra-high-density
来源:https://developer.android.com/guide/practices/screens_support.html#DesigningResources
关于android - 屏幕密度和图像尺寸,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44489892/