2 设置不可编辑 android:editable="false"
true 表示可以编辑
false 表示不可编辑
1 <?xml version="1.0" encoding="utf-8"?>
2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3 xmlns:app="http://schemas.android.com/apk/res-auto"
4 xmlns:tools="http://schemas.android.com/tools"
5 android:layout_width="match_parent"
6 android:layout_height 7 tools:context=".view.LoginActivity"
8 android:background="@drawable/login_main_bg2">
9
10 LinearLayout
11 android:layout_width 12 android:layout_height 13 android:background="#3fa0a0a0"
14 android:gravity="center"
15 android:orientation="vertical" 16
17 ImageView
18 android:id="@+id/change_user"
19 android:layout_width="100dp"
20 android:layout_height 21 android:layout_gravity="center_horizontal"
22 android:layout_marginBottom="24dp"
23 android:src="@drawable/next" />
24
25
26 RelativeLayout
27 28 ="wrap_content" 29
30 EditText
31 ="@+id/user_name"
32 android:layout_width 33 android:layout_height="50sp"
34 android:layout_margin="10dp"
35 android:background="@drawable/login_input_bg"
36 android:gravity 37 android:hint="用户名"
38 android:inputType="number"
39 android:padding="5dp" 40
41 Button
42 ="@+id/rl_user"
43 ="wrap_content"
44 45 android:layout_alignParentRight="true"
46 android:layout_centerVertical 47 ="@null"
48
49 50 </RelativeLayout 51
52
53 54 ="@+id/user_password"
55 56 57 android:layout_margin 58 android:background 59 android:gravity 60 android:hint="密码"
61 android:inputType="textPassword"
62 android:padding 63
64 65 66 67 android:layout_marginLeft 68 android:layout_marginTop="10dp" 69
70 CheckBox
71 ="@+id/cb"
72 73 74 75 76 android:text="记住密码"
77 android:textSize="18sp" 78
79 LinearLayout 80
81
82 83 ="@+id/btn_denglu"
84 ="180dp"
85 ="80dp"
86 ="right"
87 ="30dp"
88 89 90
91 92 ="@+id/btn_zhuche"
93 android:layout_width 94 95 android:layout_alignParentBottom 96 97 android:textColor="#050505"
98 android:text="还没有账号? 去创建"
99 android:textSize="18sp"
100 ="@null"101
102 >