在android studio中添加5列表格行布局
我有一个android应用程序。界面取决于在android studio中添加5列表格行布局,android,android-tablelayout,Android,Android Tablelayout,我有一个android应用程序。界面取决于表格布局,其中每一行的内容都不同于另一行。 我想在一些行中显示5列。。。这是怎么回事?您可以在每行中设置不同数量的列,下面是一个示例: <TableLayout android:layout_width="wrap_content" android:stretchColumns="*" android:layout_height="wrap_content"> <!--
表格布局
,其中每一行的内容都不同于另一行。
我想在一些行中显示5列。。。这是怎么回事?您可以在每行中设置不同数量的列,下面是一个示例:
<TableLayout
android:layout_width="wrap_content"
android:stretchColumns="*"
android:layout_height="wrap_content">
<!-- First row has 5 columns -->
<TableRow>
<TextView
android:layout_column="1"
android:text="Column 1" />
<TextView
android:layout_column="2"
android:text="Column 2" />
<TextView
android:layout_column="3"
android:text="Column 3"/>
<TextView
android:layout_column="4"
android:text="Column 4"/>
<TextView
android:layout_column="5"
android:text="Column 5" />
</TableRow>
<!-- Second row has 3 columns -->
<TableRow>
<TextView
android:layout_column="1"
android:text="Column 1" />
<TextView
android:layout_column="2"
android:text="Column 2" />
<TextView
android:layout_column="3"
android:text="Column 3"/>
</TableRow>
</TableLayout>
您可以将任何视图放入表格行