Android中登錄佈局展示Activity – Android移動開發技術文章_手機開發 Android移動開發教學課程

 

佈局文件:login_system.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:orientation="vertical" android:layout_width="fill_parent"

    android:layout_height="fill_parent" android:background="@color/red">

     

    <ImageView android:id="@+id/ImageView01"

        android:layout_height="240px" android:layout_width="wrap_content"

        android:src="@drawable/logo2" android:layout_gravity="center"></ImageView>

 

    <TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1">

        <TableRow>

            <TextView android:text="用戶名稱:" android:id="@+id/TextView"

                android:layout_width="wrap_content" android:layout_height="wrap_content"

                android:textColor="@color/blue" android:textSize="24dp"

                ></TextView>

             

            <EditText android:text="" android:id="@+id/userEditText"

                android:layout_width="fill_parent" android:layout_height="wrap_content"></EditText>

        </TableRow>

        <TableRow>

            <TextView android:text="用戶密碼:" android:id="@+id/TextView"

                android:layout_width="wrap_content" android:layout_height="wrap_content"

                android:textColor="@color/black"

                ></TextView>

            <EditText android:text="" android:id="@+id/pwdEditText"

                android:layout_width="fill_parent" android:layout_height="wrap_content"

                android:password="true"></EditText>

        </TableRow>

        <TableRow android:gravity="right">

            <Button android:text="取消" android:id="@+id/cancelButton"

                android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>

            <Button android:text="登陸" android:id="@+id/loginButton"  android:textSize="24dp"

                android:layout_width="wrap_content" android:layout_height="wrap_content"></Button>

        </TableRow>

    </TableLayout>

</LinearLayout>

2.效果圖如下:

You May Also Like