Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
209 views
in Technique[技术] by (71.8m points)

Layout Folder issue in android

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...