【发布时间】:2014-10-01 08:55:47
【问题描述】:
我正在使用表格布局来显示数据,如下所示。
我想做什么?
我想将所有内容与最大的内容对齐。如下图所示,Pilot 列的内容最多。我的意思是它应该是什么样子;
代码:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:shrinkColumns="*"
android:stretchColumns="*" >
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<others.TypefaceTextView
android:id="@+id/txtNo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
<others.TypefaceTextView
android:id="@+id/txtKapi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="1"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
<others.TypefaceTextView
android:id="@+id/txtPilotad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:maxWidth="115dp"
android:minWidth="100dp"
android:text="Y.AVCI"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
<others.TypefaceTextView
android:id="@+id/txtSinif"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="S2"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
<others.TypefaceTextView
android:id="@+id/txtZaman"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="17:45:5"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
<others.TypefaceTextView
android:id="@+id/txtFark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="17:45:5"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
<others.TypefaceTextView
android:id="@+id/txtOndeki"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="17:45:5"
app:customTypeface="fonts/RobotoCondensed-Light.ttf" />
</TableRow>
【问题讨论】:
标签: android alignment android-tablelayout