最后一行的两个按钮,我想让他们能打满这一行,就是一个按钮占两格,该怎么做呢,整个布局,我用的是Tablelayout
<TableLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TableRow>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="第一个按钮">
</Button>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="第二个按钮">
</Button>
</TableRow>
</TableLayout>
效果如下:
button的宽用match_那个属性
后边那个button
** android:layout_weight="1"**