AndroidstudioAPP开发表格布局⽤表格布局写⼀个⽤户登录界⾯表格布局 表格布局就是以⾏列的形式来管理布局管理器中的组件,使组件以特定的⾏列排列
表格布局⽤TableLayout标记定义,在表格布局中,⽤TableRow来标记,每个TableRow占⽤⼀⾏
TableLayout⽀持的属性
属性作⽤
android:collapseColums设置需要被隐藏的列序号(序号从0开始),多个列序号之间⽤逗号隔开 android:shrinkColums设置允许被收缩的列的列序号(序号哦才能够0开始),多个列序号之间⽤逗号隔开android:stretchColums设置允许被拉伸的序列号(序号从0开始), 多个列序号之间⽤逗号隔开
<TableLayout xmlns:android="schemas.android/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="20dp"
android:weightSum="15">
智慧杀虫灯<TableRow
android:id="@+id/tableRow1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="6dp">
<TextView/>
<TextView
android:text="⽤户名"
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:textSize="24sp"/>
对扣
<EditText
android:id="@+id/editText1"箱型钢
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="24sp"
android:minWidth="200dp"/>
</TableRow>
<TableRow
顶到子宫肚子涨
android:id="@+id/tableRow2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="6dp">
<TextView/>
<TextView
线路保护
android:text="密码"
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:textSize="24sp"/>
<EditText
android:id="@+id/editText2"
android:id="@+id/editText2"
小型生物反应器
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:textSize="24sp"
android:minWidth="200dp"
android:inputType="textPassword"/>
</TableRow>
<TableRow
android:id="@+id/tableRow3"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:padding="10dp">
<TextView/>
<Button
android:text="登录"
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@color/colorAccent" android:textSize="24sp"/>
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text="退出"
android:background="@color/colorAccent" android:textSize="24sp"
android:minWidth="200dp"/>
</TableRow>
</TableLayout>