문제

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

도움이 되었습니까?

해결책

Define your xml's in following folders :

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top