A friendly interface is very important when users need to input data. Therefore, if we can give users some prompts in the input box, it will improve the ease of use of the program, android provides us with this attribute, that is, Android: hint.
In addition, the textview of this program uses the shape attribute in Android. For more information, see my previous blog reposted.
<? XML version = "1.0" encoding = "UTF-8"?> <Tablelayout xmlns: Android = "http://schemas.android.com/apk/res/android" Android: Orientation = "vertical" Android: layout_width = "fill_parent" Android: layout_height = "fill_parent"> <tablerow> <textviewandroid: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: text = "username:" Android: textsize = "10sp" Android: background = "@ drawable/bg_border"/> <edittext Android: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: hint = "please fill in the Logon account" Android: selectallonfocus = "true"/> </tablerow> <textviewandroid: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: text = "Password:" Android: textsize = "10pt" Android: Background = "@ drawable/bg_border"/> <edittextandroid: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: password = "true"/> </tablerow> <textviewandroid: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: text = "phone number:" Android: textsize = "10pt" Android: Background = "@ drawable/bg_border"/> <edittextandroid: layout_width = "fill_parent" Android: layout_height = "wrap_content" Android: hint = "Enter your phone number" Android: selectallonfocus = "true" Android: phonenumber = "true"/> </tablerow> <button Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: text = "register"/> </tablelayout>
Used shape File
<?xml version="1.0" encoding="UTF-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#000000"/><stroke android:width="2dip" android:color="#ff0000" /></shape>