Search code examples
androidandroid-layoutandroid-screen-support

How to manage the different size of layout


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


Solution

  • Define your xml's in following folders :

    layout-hdpi  - for 480x800 (Samsumg Galaxy S2)
    layout-large - for Nexus 7"
    layout-xlarge - for 10" tablet