This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15756|Reply: 0

[Xamarin for Android] android-TableLayout as well as the use of TableRow

[Copy link]
Posted on 12/17/2017 10:53:37 PM | | | |

android-TableLayout as well as the use of TableRow

TableLayout is a layout that can create tables, the difference between it and GridLayout is that GridLayout can only set table layouts of the same width for each column, while TableLayout can make table layouts with different widths for each column.

Main properties of TableLayout:

android:collapseColumns=”0,1” 隐藏第0列和第1列
android:stretchColumns=”0,1” 第0列和第1列可以向行方向扩展
android:stretchColumns=”*” 所有列可以向行方向扩展
android:shrinkColumns=”0,1” 第0列和第1列可以向列方向扩展

The main properties of the TableRow's sub-control:

android:layout_column=”1” 该控件显示在第1列
android:layout_span=”2” 该控件占据2列

Note: The sub-control in TableLayout can be TableRow or other View, but the android:layout_width attribute of its sub-control is fixed to match_parent by the system, and the maximum width of a column in all rows in TableLayout is the width of this column.

Code example
Run result:






Previous:The difference between Android :p addingbottom and Android:layout_marginBottom
Next:WPF RelayCommand
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com