0
我已经尽了我的努力寻找网络,但我似乎无法为以下找到适当的解决方案。Android按钮对齐
我正在使用表格布局和表格行,并且我正在使用TEXT的3个按钮。以下是布局文件的示例。
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tlRemoteTable"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:stretchColumns="*">
<TableRow
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="ABCD" />
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="ABCDEFGHI" />
<Button
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="ABCDEFGHIJKLMNOP" />
</TableRow>
</TableLayout>
图像的结果是在这里:
我的目标是使之更,所有有1/3的比例。我知道文本长度是迫使它扩展的文本长度。我如何包装文字呢?
最终结果将是一个动态生成的文件。所以我会编写它,而不是XML。