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。