EditText in Android

531 views.

A EditText is an overlay over TextView that configures itself to be editable. It is the predefined subclass of TextView that includes rich editing capabilities.

STYLES OF EDIT TEXT
EditText Attributes
Following are the important attributes related to EditText control. You can check Android official documentation for complete list of attributes and related methods which you can use to change these attributes are run time.

Inherited from android.widget.TextView Class −

Attribute Description
android:autoText If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors.
android:drawableBottom This is the drawable to be drawn below the text.
android:drawableRight This is the drawable to be drawn to the right of the text.
android:editable If set, specifies that this TextView has an input method.
android:text This is the Text to display.
Inherited from android.view.View Class −

Attribute Description
android:background This is a drawable to use as the background.
android:contentDescription This defines text that briefly describes content of the view.
android:id This supplies an identifier name for this view,
android:onClick This is the name of the method in this View’s context to invoke when the view is clicked.
android:visibility This controls the initial visibility of the view.
Example
This example will take you through simple steps to show how to create your own Android application using Relative Layout and EditText.

mainactivity.java

 

You may also like...

Leave a Reply