Fifth lesson for Joshui teacher
One, set an input box
To add a control:
<edittext android:layout_width= "fill_parent" android:layout_height= "Wrap_content" android: layout_margintop= "52DP" <!--the distance of the top of the control from the previous control--
Two, eliminate the focus of the input box
method One:
<edittext android:layout_width= "0DP" android:layout_height= "0DP" android:layout_margintop= "52DP " /> <edittext android:layout_width=" fill_parent " android:layout_height=" Wrap_content " android:layout_margintop= "52DP" />
Method Two:
<edittext android:layout_width= "fill_parent" android:layout_height= "Wrap_content" android: layout_margintop= "52DP" > <requestfocus/>
third, limit the input content and length
Android:maxlength= "3" android:inputtype= "number"
Four. Set Prompt information
android:hint= "Input three digits"
Five. Add a picture to the input box
Put the picture tubiao.jpgandroid:drawableleft= "@drawable/tubiao" in drawable-mdpi
Six, turn the input box to rounded corners
Set up file Shape.xml in drawable-mdpi: <shape xmlns:android= "Http://schemas.android.com/apk/res/android" Android:shape= "Rectangle" > <solid android:color= "#e2e2e2" > </solid> <corners android:radius= "7DP" <!--set radians-- android:topleftradius= "5DP" android:toprightradius= " 5DP "> </corners></shape>
attached Shortcut keys in eclipse
Android Layout properties, Tag Properties Summary
EditText Properties of Android development
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Learning Note (2) EditText Control Learning