刚刚学习Android开发,现在工作需要开发一个app的演示程序,首先就是要开发一个登录界面了。在网上找了很多材料,最后参考了博客中的登录界面设计方法:
blog.csdn.net/StayFoolish_Fan/article/details/51933563?locationNum=8
最终我设计的登录界面以及注册界面如图所示:
登录界面布局代码为:activity_login.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
/>
<RelativeLayout
android:id="@+id/login_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_below="@+id/toolbar"
android:focusable="true"
android:focusableInTouchMode="true"
>
<LinearLayout
android:layout_width="match_parent"