表格布局需要和TableRow配合使用,每一行都由TableRow对象组成,因此TableRow的数量决定表格的行数。而表格的列数是由包含多个控件的TableRow决定的。如第一个TableRow有2个控件,第二个TableRow有3个控件,那么表格的列数是3。
1.表格布局的属性:
2.表格布局控件属性
如下是一个列子:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:lay