Notice that this file is similar to the structure of the table in HTML. The TableLayout element is like the
element in HTML; the TableRow is like a
element; But for each cell, you can use various view elements. In this example, each cell uses TextView. Between these rows, there is also a basic View for drawing horizontal lines
TextView Some attributes in
android:layout_column="1": Indicates that the control is placed on the column numbered 1, and the number starts from 0
android:gravity="right": Definition The font is displayed on the right in the parent control
android:stretchColumns="1": Set which columns to automatically stretch. The column ID starts from 0. If there are multiple columns, use "," to separate them. The function here is to allow the second column to expand to all available space
android:shrinkColumns: Set which columns to automatically shrink. The column ID starts from 0. If there are multiple columns, use "," to separate them
android:collapseColumns: Set which columns to automatically hide. The column ID starts from 0. If there are multiple columns, use "," to separate them
By the way: android:layout_span indicates how many columns of space a control occupies
The following is the basic View, which is to draw a horizontal line 2dip high on the screen
The above is the content of the Android UI control series: TableLayout (table layout). For more related content, please pay attention to the PHP Chinese website (www.php.cn)!
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn