Layout Management Code
<linearlayout 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:paddingbottom= "@dimen/activity_vertical_margin"
android:paddingleft= "@dimen/activity_horizontal_margin"
android:paddingright= "@dimen/activity_horizontal_margin"
android:paddingtop= "@dimen/activity_vertical_margin"
android:orientation= "Vertical"
Tools:context= ". Mainactivity ">
<!--android:orientation= "vertical" is a linear interface that allows the interface to be applied vertically--
<!--QQ to the interface needs to write the information--
<textview
Android:id= "@+id/tv_number"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "QQ Account"
/>
<!--android:hint= "QQ number/Mobile phone number/mailbox" where hint is the content to be hidden when you enter it--
<edittext
Android:id= "@+id/et_number"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:hint= "QQ number/Mobile number/email"
android:layout_below= "@+id/tv_number"
/>
<textview
Android:id= "@+id/tv_pwd"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "QQ Password"
/>
<!--android:password= "true" where password is the password to be hidden into the * number, to ensure that content security
True is to agree to hide the password, false to not agree to hide the password
-
<edittext
Android:id= "@+id/et_pwd"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:password= "true"
android:hint= "Password"
/>
<!--switch to a relative interface--
<relativelayout
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
>
<!--checkbox is a check box that prompts you to remember the password--
<checkbox
Android:id= "@+id/cb_cb"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "Remember user name and password"
/>
<!--is a login button android:onclick= "Click" is the fourth way to use the button directly when calling the method
Android:layout_width= "100DP" to make the login button box larger
android:layout_marginleft= "60DP" button like right shift 60DP, is to keep the button and the checkbox 60DP distance
-
<button
android:onclick= "click"
Android:layout_width= "100DP"
android:layout_marginleft= "60DP"
android:layout_height= "Wrap_content"
android:text= "Login"
android:layout_torightof= "@+id/cb_cb"
/>
</RelativeLayout>
</LinearLayout>
Code in Mainactivity
<linearlayout 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:paddingbottom= "@dimen/activity_vertical_margin"
android:paddingleft= "@dimen/activity_horizontal_margin"
android:paddingright= "@dimen/activity_horizontal_margin"
android:paddingtop= "@dimen/activity_vertical_margin"
android:orientation= "Vertical"
Tools:context= ". Mainactivity ">
<!--android:orientation= "vertical" is a linear interface that allows the interface to be applied vertically--
<!--QQ to the interface needs to write the information--
<textview
Android:id= "@+id/tv_number"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "QQ Account"
/>
<!--android:hint= "QQ number/Mobile phone number/mailbox" where hint is the content to be hidden when you enter it--
<edittext
Android:id= "@+id/et_number"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:hint= "QQ number/Mobile number/email"
android:layout_below= "@+id/tv_number"
/>
<textview
Android:id= "@+id/tv_pwd"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
android:text= "QQ Password"
/>
<!--android:password= "true" where password is the password to be hidden into the * number, to ensure that content security
True is to agree to hide the password, false to not agree to hide the password
-
<edittext
Android:id= "@+id/et_pwd"
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
Android:password= "true"
android:hint= "Password"
/>
<!--switch to a relative interface--
<relativelayout
Android:layout_width= "Match_parent"
android:layout_height= "Wrap_content"
>
<!--checkbox is a check box that prompts you to remember the password--
<checkbox
Android:id= "@+id/cb_cb"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:text= "Remember user name and password"
/>
<!--is a login button android:onclick= "Click" is the fourth way to use the button directly when calling the method
Android:layout_width= "100DP" to make the login button box larger
android:layout_marginleft= "60DP" button like right shift 60DP, is to keep the button and the checkbox 60DP distance
-
<button
android:onclick= "click"
Android:layout_width= "100DP"
android:layout_marginleft= "60DP"
android:layout_height= "Wrap_content"
android:text= "Login"
android:layout_torightof= "@+id/cb_cb"
/>
</RelativeLayout>
</LinearLayout>
:
Android UI Login Interface case