制作登录界面的布局时候,可以使用 android:stretchColumns="0,3"
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center_vertical"android:stretchColumns="0,3"><TableRowandroid:layout_width="wrap_content"android:layout_height="wrap_content"><TextView/><TextViewandroid:textSize="24px"android:text="@string/hello_world"android:layout_width="wrap_content"android:layout_height="wrap_content"/><EditTextandroid:layout_width="wrap_content"android:minWidth="145dp"android:layout_height="wrap_content"/><TextView/></TableRow><TableRowandroid:layout_width="wrap_content"android:layout_height="wrap_content"><TextView/><TextViewandroid:textSize="24px"android:text="@string/hello_world"android:layout_width="wrap_content"android:layout_height="wrap_content"/><EditTextandroid:layout_width="wrap_content"android:minWidth="145dp"android:layout_height="wrap_content"/><TextView/></TableRow><TableRowandroid:layout_width="wrap_content"android:layout_height="wrap_content"><TextView/><TextViewandroid:textSize="24px"android:text="@string/hello_world"android:layout_width="wrap_content"android:layout_height="wrap_content"/><EditTextandroid:layout_width="wrap_content"android:minWidth="145dp"android:layout_height="wrap_content"/><TextView/></TableRow></TableLayout>

android:stretchColumns="0,3"
拉伸第一个和第4个 这个属性在tablelayout布局里使用
制作登录界面的布局时候,可以使用

浙公网安备 33010602011771号