1

To suit different device I need to set different layout. After having reviewed Supporting Multiple Screens, I didn't find what I want.

It seems that what I need it to set Aspect ratio to long. But how to manage different size? 1280x720, 1280x768, 1280x800 etc. I create folder res/layout-480x800. But eclipse warn me it's a invalid name. Through the article I found what I can only use Size,Density,Orientation and Aspect ratio. Could anybody show me how to do it? thx in advance.

Here is a pic to help you understand what I ask. the pieces is 2x2 or 2x1 with a divider.

enter image description here

Renjith
  • 5,783
  • 9
  • 31
  • 42
blackdog
  • 2,007
  • 3
  • 25
  • 43

2 Answers2

2

Define your xml's in following folders :

layout-hdpi  - for 480x800 (Samsumg Galaxy S2)
layout-large - for Nexus 7"
layout-xlarge - for 10" tablet
René Höhle
  • 26,716
  • 22
  • 73
  • 82
kapil thadani
  • 1,425
  • 14
  • 26
0

thanks to https://stackoverflow.com/a/12258061/1160282 I solve my problem. I create res/layout-sw??dp to fix different size.

Community
  • 1
  • 1
blackdog
  • 2,007
  • 3
  • 25
  • 43