【发布时间】:2020-07-30 21:48:15
【问题描述】:
我有一个垂直方向的LinearLayout,在第一行我添加了一个填充父级的按钮。
我想使用 TableLayout 实现同样的功能。
到目前为止我尝试过的是:
<TableLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/firstRow">
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Button" />
</TableRow >
</TableLayout>
TableRow 填充父级,但行内的按钮不会填充整行。
如何让按钮像这样填充父级?
编辑:
以及如何让它像这样垂直填充父级:
【问题讨论】:
标签: android android-layout android-tablelayout