Android的布局设计为平板电脑和设备平板、布局、设备、电脑

2023-09-08 08:52:53 作者:丶自私

我们如何设计布局的所有决议,这两个设备和tabltes在此请指点..三江源

How can we design the layouts for both devices and tabltes of all resolutions please advice on this.. thankyou

推荐答案

请参照第一本:的支持多种屏幕

如果你有麻烦然后告诉我们,你就有麻烦了。

If you got trouble then tell us where you got trouble.

享受。 :)

更新您需要创建差异屏幕大小不同的布局。支持所有的屏幕,您需要创建以下布局:

Updated You need to create different layout for diff screen size. Support all screen you need to create following layout:

Low density Small screens QVGA 240x320 (120dpi):

layout-small-ldpi (240x320)  
layout-small-land-ldpi (320x240)

Low density Normal screens WVGA400 240x400 (x432) (120dpi):

layout-ldpi  (240 x 400 )
layout-land-ldpi  (400 x 240 )
Medium density Normal screens HVGA 320x480 (160dpi):

layout-mdpi (320 x 480 )
layout-land-mdpi (480 x 320 )

Medium density Large screens HVGA 320x480 (160dpi):

layout-large-mdpi (320 x 480 )
layout-large-land-mdpi (480 x 320)
Galaxy Tab ( 240 dpi ):

layout-large  (600 x 1024) 
layout-large-land  (1024 x 600)

High density Normal screens WVGA800 480x800 (x854) (240 dpi):

layout-hdpi (480 x 800)
layout-land-hdpi (800 x 480)

Xoom (medium density large but 1280x800 res) (160 dpi):

layout-xlarge (800 x 1280)
layout-xlarge-land (1280 x 800)

另外补充按照文件名为.manifest code:

Also add following code in .manifest file:

<supports-screens                                 
    android:smallScreens="true"                    
    android:normalScreens="true"         
    android:largeScreens="true"            
    android:xlargeScreens="true"             
    android:anyDensity="true" />