Shashank Degloorkar
Shashank Degloorkar

Reputation: 3221

7 inch tablet with resolution 480X800 layout issue

I have

layout

layout-large

layout-xlarge

folders in my res folder.

But despite being a 7 inch tablet the layouts are picked from layout folder instead of layout-large.

and device runs on android 4.0

Am i missing something?? Thanks.

Upvotes: 0

Views: 4136

Answers (3)

Sara
Sara

Reputation: 1874

Check the correct device resolution and follow the charts offered by Android: http://developer.android.com/guide/practices/screens_support.html

Configuration examples:

To help you target some of your designs for different types of devices, here are some numbers for typical screen widths:

  • 320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
  • 480dp: a tweener tablet like the Streak (480x800 mdpi).
  • 600dp: a 7” tablet (600x1024 mdpi).
  • 720dp: a 10” tablet (720x1280 mdpi, 800x1280 mdpi, etc).

in your case you need to create a "layout-600dp" folder inside your "res" folder.

Upvotes: 2

Abhay Kumar
Abhay Kumar

Reputation: 1618

Because the DP of the device is 160dp/inch which falls under the category of mdpi devices

Upvotes: 0

Paresh Mayani
Paresh Mayani

Reputation: 128428

Check Configuration examples in Supporting Multiple screens document.

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)

Upvotes: 3

Related Questions