After searching a lot I found the link where I got expected and useful information.
Android app icon dimensions [Not launcher icons]
-
21-09-2022 - |
質問
Which icon size will be preferable to support different screen sizes in Android? The dimensions provided:
- ldpi-36*36 px
- mdpi-48*48 px
- hdpi-72*72 px
- xhdpi-96*96 px
worked fine for launcher icon but not for icons inside the app like ImageButtons. Can anybody help me to find out correct dimensions for ImageButtons? Thanks in advance..
解決 2
他のヒント
You should use dp instead of px. The density-independent pixel is equivalent to one physical pixel on a 160 dpi screen, which is the baseline density assumed by the system for a "medium" density screen.
Conversion: px= dp * (dpi / 160)
For example, on a 240 dpi screen, 1 dp equals 1.5 physical pixels.
ldpi: 24*24 px NORMAL*0.75
mdpi: 32*32 px NORMAL
hdpi: 48*48 px NORMAL*1.5
xhdpi: 64*64 px NORMAL*2
manually you can calculate your sizes using the conversion from above