2012-10-04 3 views

답변

4

당신은

그래서 우선

는 선형 레이아웃 지금, fill_parent로 폭을 제공 2.

로 weighSum 속성을 추가 걸릴 ... 무게와없는 랩 컨텐츠/일치 부모 등로를 사용하여 폭을 분할해야

:

지금

전체 코드가 여기에있다 .... layout_width = 0dp

와 2 개 버튼을 추가하고 두 버튼에 layout_weight를 = 1을 추가

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:weightSum="2" > 

<Button 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:text="Aamir Shah" /> 

<Button 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_weight="1" 
    android:text="Aamir Shah" /> 

</LinearLayout> 
관련 문제