Layout Folder issue in android

帅比萌擦擦* 提交于 2019-12-13 07:55:00

问题


In my app there are three layout folder.

1)layout(for 480x800 resolution with **hdpi**)
2)layout-large(for 1024x600 resolution with **mdpi**)
3)layout-xlarge(for 1280x800 resolution with **mdpi**)

but i have new tablet for i-ball with resolution (1024x600 -> **hdpi**).

i don't know how to create design for this tablet.

this i-ball device is take layout file from layout layout(for 480x800 resolution with hdpi) folder. but its not looking good design compare with other resolution devices.

Please give me solution for design issue in this device .

Thanks in advance.


回答1:


Samsung Galaxy S3 has same issue..

Here is sample logic of achieve for Samsung Galaxy S3 device, you can also try for your device.

for example to find the Samsung Galaxy S3 dp to suffix to drawable-sw?

dp With reference of DP Calculation, If you want to support your layout or drawable to S3 then the calculation says

px= Device's width = 720 dpi= Device's density= 320

formula given

px = dp * (dpi / 160)

interchanging formula because we have px's value

dp = px / (dpi / 160)

now putting value,

 dp= 720 / (320/160);
 dp=360. 

so drawable-sw360dp will do the job

Check this Answer for more detail.



来源:https://stackoverflow.com/questions/18931109/layout-folder-issue-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!