Android Multiscreen Support in android : 540x960 issue

前端 未结 3 1413
一个人的身影
一个人的身影 2020-12-10 08:59

My application is supporting 3 type of density ldpi (120),mdpi(160),hdpi(320) and for that we have three folder for resources (ldpi,mdpi,hdpi).

But my problem is occ

3条回答
  •  萌比男神i
    2020-12-10 09:12

    You have to name the drawable as per your pixel density and the screen size. The calculation is here...

    dpi = sqrt (540^2+960^2) / 4.3"(Device size) = ~256 dp = px / (dpi / 160) = 540 / (dpi / 160) = 330

    The drawable will be named as drawable-sw330dp. I have tested this. And this works good. No problem with other drawables either. Layout Will be layout-sw330dp

    Or you can try this by drawable-sw540p. I haven't tested it yet. But I guess it will work good. Layout Will be layout-sw540p

提交回复
热议问题