سؤال

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