我要删除的之间的按钮"0",并将按"1". 我的目标是具有同样的空间,它们之间的按钮"X"。 UI结果
这些解决方案没有工作:
此外,按钮"X"应该跨越两个行,这只不,当我放在一个更大的 textSize
.
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TableRow>
<TableLayout android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1">
<TableRow android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="0sp"
android:padding="0sp">
<com.google.android.material.button.MaterialButton
android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="0"
android:layout_margin="2sp"
/>
</TableRow>
<TableRow
android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="0sp"
android:padding="0sp">
<com.google.android.material.button.MaterialButton
android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="1"
android:layout_margin="2sp"
/>
</TableRow>
</TableLayout>
<TableLayout
android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_margin="0sp"
android:padding="0sp">
<TableRow>
<com.google.android.material.button.MaterialButton
android:layout_width="0sp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="X"
android:layout_margin="2sp"
/>
</TableRow>
</TableLayout>
</TableRow>
</TableLayout>
预先感谢任何的想法。
insetBottom
和insetTop
我最终得到了它。 :)