方便使用的輸入介面,方便使用輸入介面
Demo2\youhao\src\main\res\layout\activity_main.xml
1 <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 xmlns:tools="http://schemas.android.com/tools" 3 android:layout_width="match_parent" 4 android:layout_height="match_parent" 5 android:stretchColumns="1" 6 tools:context=".MainActivity"> 7 8 <TableRow> 9 10 <TextView11 android:layout_width="match_parent"12 android:layout_height="wrap_content"13 android:text="使用者名稱"14 android:textSize="16dp" />15 16 <EditText17 android:layout_width="match_parent"18 android:layout_height="wrap_content"19 android:hint="請填寫登入帳號"20 android:selectAllOnFocus="true" />21 </TableRow>22 23 <TableRow>24 25 <TextView26 android:layout_width="match_parent"27 android:layout_height="wrap_content"28 android:text="密碼"29 android:textSize="16dp" />30 31 <EditText32 android:layout_width="match_parent"33 android:layout_height="wrap_content"34 android:hint="請填寫登入密碼"35 android:inputType="numberPassword" />36 </TableRow>37 38 <TableRow>39 40 <TextView41 android:layout_width="match_parent"42 android:layout_height="wrap_content"43 android:text="年齡"44 android:textSize="16dp" />45 46 <EditText47 android:layout_width="match_parent"48 android:layout_height="wrap_content"49 android:hint="請填寫年齡"50 android:inputType="number" />51 </TableRow>52 53 <TableRow>54 55 <TextView56 android:layout_width="match_parent"57 android:layout_height="wrap_content"58 android:text="生日"59 android:textSize="16dp" />60 61 <EditText62 android:layout_width="match_parent"63 android:layout_height="wrap_content"64 android:hint="請填寫生日"65 android:inputType="date" />66 </TableRow>67 68 <TableRow>69 70 <TextView71 android:layout_width="match_parent"72 android:layout_height="wrap_content"73 android:text="電話號碼"74 android:textSize="16dp" />75 76 <EditText77 android:layout_width="match_parent"78 android:layout_height="wrap_content"79 android:hint="請填寫電話號碼"80 android:inputType="phone"81 android:selectAllOnFocus="true" />82 </TableRow>83 84 <Button85 android:layout_width="wrap_content"86 android:layout_height="wrap_content"87 android:text="註冊88 " />89 </TableLayout>