开发者

Android Simulator: How to get it to detect layout-large?

开发者 https://www.devze.com 2023-04-01 14:57 出处:网络
For the Android 开发者_StackOverflowSimulator, I\'ve tried many things to try and get Android to detect that I have a large screen (to get it to use the xml files found in layout-large folder), but it

For the Android 开发者_StackOverflowSimulator, I've tried many things to try and get Android to detect that I have a large screen (to get it to use the xml files found in layout-large folder), but it always falls back to the normal layout (xml files in layout folder). I've tried the following:

  1. Set simulator resolution to 1024x768
  2. Set abstract LCD density to 350
  3. Set it to scale to real size (in the dialog box right after clicking "start")

Is there something I'm missing to force android to use the layouts in layout-large folder?


Have you tried creating Android virtual device, targeting >= Android 3.0 (Api 11) with default WXGA screen?


If you want to target specifics sizes (like 7" or 10")

res/layout/main_activity.xml           # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml   # For 7” tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml   # For 10” tablets (720dp wide and bigger)

Otherwise, the info (and the code i just showed to you), on this link : http://developer.android.com/guide/practices/screens_support.html

Hope it helps!

0

精彩评论

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