开发者

Android layout: distinguishing an 800x480 large device from a 1024x600 tablet

开发者 https://www.devze.com 2023-02-18 19:09 出处:网络
Is there a way using Android layout to automatically distinguish between f/ex a Dell Streak with 800x480 resolution, and a Galaxy Tab or HTC Flyer with 1024x600 resoluti开发者_JS百科on? They all (pres

Is there a way using Android layout to automatically distinguish between f/ex a Dell Streak with 800x480 resolution, and a Galaxy Tab or HTC Flyer with 1024x600 resoluti开发者_JS百科on? They all (presumably including the Flyer) report as -large (unlike the Xoom which reports as -xlarge). Is there a better layout tag than -large?

(Edited to clarify that -xlarge is no use in this case)


See the "Table 2" in Supporting Multiple Screens and try to combine Size and Density qualifiers together. Also useful application ScreenInfo

Еxample:

Nexus One (480*800, 240 dpi) - "layout-hdpi" (normal screen, high density)

Samsung Galaxy Tab(600*1024, 169 ppi/dpi) - "layout-large-mdpi" (large screen, medium density)

Dell Streak(480*800, 186 dpi) - ??? (normal/large? screen, medium/high? density)

Android layout: distinguishing an 800x480 large device from a 1024x600 tablet


For a tablet the xlarge screensize was introduced in API9. So if you want a special layout for xlarge(tablets) screens you'd put it in a layout-xlarge directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号