2012-05-03 3 views

답변

1

사용 방법에 따라 다릅니다.

레이아웃을 자동으로 크기 조정하려는 경우 LinearLayout을 구성하는보기에 weight 매개 변수를 지정할 수 있습니다. 예를 들어

:

<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:weightSum="1" 
    android:orientation="horizontal" 
> 
    <SomeView 
     android:layout_width="0dip" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.5" 
    /> 

    <SomeView 
     android:layout_width="0dip" 
     android:layout_height="wrap_content" 
     android:layout_weight="0.5" 
    /> 
</LinearLayout> 

당신이 파단 전체 수평 공간을 공유합니다이 경우 그 중 각각의 하나는 공간의 50 %를 취할 것입니다.

관련 문제