<edittext
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
Android:maxlength= "4"//Limit the number of words we enter
Android:singleline= "true"//limit us whether the input box is full after a newline, true means no line break
Android:inputtype= "number"//limit our input data type, numbers only indicate input digits
Android:hint= "Only allow input number"//In the input box to prompt us to enter the information
android:drawableleft= "@drawable/title"//on the left of the text box, a picture named title is displayed, and the picture is copied to drawable in advance title.jpg
/>
Change the shape of the input box
1. Create a new shape.xml in drawable and put the following code
<?xml version= "1.0" encoding= "UTF-8"?>
<shape xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:shape= "Rectangle" >
<!--fill Color-
<solid android:color= "#FFFFFF"/>
<!--set the Four corners of the rectangle to arc--
<!--Android:radius Arc radius--
<corners android:radius= "7dip"/>
</shape>
2, add in the Main.xml<edittext
android:background= "@drawable/shape"
Android EditText controls