

It sets the maximum number of lines that the EditText view can accomodate, visually. So, if you enter a value 2, then by default the EditText view will be 2 lines tall, even without any text added to it. It provides the view, with a height equivalent to the specified number of lines on the screen. To specify the keyboard action button, use the android:imeOptions attribute with an action value such as actionSend or actionSearch etc. In most input methods, like keyboard or SMS sending form, the bottom right corner of the keyboard has an action button appropriate for that input method. We can use more than one constant value, by separating them using |, for example :Īndroid:inputType="textCapSentences|textAutoCorrect"

It can be either single line or multi-line. EditText is used when you want to have a text field in your application where user can enter any text. It has almost similar properties as a TextView. Android SDK Manager & required PackagesĮditText is a TextView which is editable.Step 3 − Add the following code to src/MainActivity.java package In the above code, we have taken edit text, To change line color use the following code for edit text - can change color as per project requirement. Step 2 − Add the following code to res/layout/activity_main.xml. Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project. This example demonstrate about how to change line color in EditText. In some situations, we should change edit text bottom line color according to background color.
