Use the smallest width qualifier -Android

怎甘沉沦 提交于 2020-01-14 06:44:09

问题


Android documentation Use the Smallest-width Qualifier states:

res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)

600dp: a 7” tablet (600x1024 mdpi).
720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc)

meaning that screen widths with 660dp and higher are tablets like. But a phone with lets say only 5.5 inches and 1440x2960 570dpi doesnt mean that it is a tablet.

So how can you distinguish that difference?

Thanks


回答1:


But a phone with lets say only 5.5 inches and 1440x2960 570dpi doesnt mean that it is a tablet.

Correct.

So how can you distinguish that difference?

Use the smallest-width qualifier.

1440 pixels at 570 dpi = 2.53 inches = 404dp. 404dp is less than 600dp, and so your proposed device would not use -sw600dp resources.



来源:https://stackoverflow.com/questions/49796388/use-the-smallest-width-qualifier-android

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