Tablelayout can organize views into rows or columns. You can use the <TableRow> element to specify a row in the table. Each row can also contain one or more views. Each view in each row makes up one element of the table. The width of each column is determined by the view with the largest width in the column.
Observe the code in the Main.xml:
<?xml version= "1.0" encoding= "Utf-8"?> <tablelayout xmlns:android= "http://schemas.android.com/apk/res/" Android "Android:layout_width=" Fill_parent "android:layout_height=" fill_parent "> <tablero
w> <textview android:text= "User Name:" android:width= "120DP"/>
<edittext android:id= "@+id/txtusername" android:width= "200DP"/>
</TableRow> <TableRow> <textview android:text= "Password:"/>
<edittext android:id= "@+id/txtusername" android:password= "true"/> </TableRow> <TableRow> <textview/> <c
Heckbox android:id= "@+id/chkrememberpassword" android:layout_width= "Fill_parent" Android:layout_height= "Wrap_cOntent "android:text=" Remember Password "/> </TableRow> <TableRow>
<button android:id= "@+id/buttonsignin" android:text= "Log in"/> </TableRow> </TableLayout>
Effect diagram on Simulator:
In the example above, there are 2 columns and 4 rows in Tablelayout. Just below the "Password" TextView view is an empty <TextView> element. If not, the "Remember Password" checkbox appears under the Password TextView view, like this:
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/extra/