0
안드로이드에서 TableLayout을 배우고 있으며 다음 레이아웃에서 약간의 불일치가 발생합니다. 나는 두번째 줄에 3 개의 버튼과 2 개의 버튼을 가지고있다. 다음은 코드입니다 : 테이블 레이아웃의 버튼 너비
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TableRow
android:id="@+id/tableRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button2"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1" />
<Button
android:id="@+id/button1"
android:layout_height="wrap_content"
android:text="this Button is big"
android:layout_weight="1" />
<Button
android:id="@+id/button3"
android:layout_height="wrap_content"
android:text="button"
android:layout_weight="1" />
</TableRow>
<TableRow
android:id="@+id/tableRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<Button
android:id="@+id/button4"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1" />
<Button
android:id="@+id/button5"
android:layout_height="wrap_content"
android:text="Button"
android:layout_weight="1" />
</TableRow>
</TableLayout>
가운데 버튼의 텍스트가 큰
이 두 버튼은 자신의 체중이 동일하고 동등한 inspite오고되지 않습니다. 그러나 마지막 버튼의 텍스트가 증가하면 버튼이 동일 해집니다. 친절 두 이미지가 감사 있는 가운데 텍스트가 부착 더 큰 경우 버튼이 동일 오지 않을 이유 업데이트
tablelayout의 하위 항목에 너비를 지정하지 않아도됩니다. https://developer.android.com/ reference/android/widget/TableLayout.html – user2779311