3

Android入门第7天-TableLayout

 1 year ago
source link: https://blog.csdn.net/lifetragedy/article/details/127705148
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

这个布局超级常用,我给各位截几个图你们就知道它用在哪些场景了。

6713476c415a4cdfa522ffb7c15f25e7.png
0fdf74697fe243b49d749427ac67da26.png

Table布局简单例子

在学习TableLayout时,记得几个要领就行了。它就和我们的最早的在学HTML时那种<table>一样后面变成了<div>。它被大量使用在表单布局器里用来做层次布局用的。

一个TableLayout有几行,就内嵌几层 <TableRow>。

一行里有几列就依赖于一个<TableRow>里有几个控件,它们会自动从左到右依次排开,一个控件就一列。如下面这个例子,它有4个button就有4列:

785e0559da684faa8a835d30ad84c706.png

以下是代码


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK