문제

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

After searching a lot I found the link where I got expected and useful information.

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top