Summary of inputType attributes in EditText

  • 2021-01-14 06:36:03
  • OfStack

This paper summarizes and analyzes inputType attributes in EditText programming development. To share with you for your reference, as follows:

android 1.5 added the software virtual keyboard function, so there will be a corresponding soft keyboard mode in the input prompt.

In android, the inputType attribute plays an important role in the style of the virtual keyboard that is started when EditText enters a value. It's also very convenient to operate. Sometimes you need a virtual keyboard for characters only or numbers only. So inputType is very important.

<EditText android:layout_width="fill_parent" android:layout_height="wrap_content"android:inputType="phone" />

Text type, mostly uppercase, lowercase, and numeric symbols.
android:inputType="none"
android:inputType="text"
android:inputType="textCapCharacters" capital letters
android:inputType="textCapWords" capitalized
android:inputType="textCapSentences" capitalized first letter only
android:inputType="textAutoCorrect
android:inputType="textAutoComplete
android:inputType="textMultiLine" multi-line input
android:inputType="textImeMultiLine" input method with multiple lines (if supported)
android: inputType = "textNoSuggestions" not prompt
android: inputType = "textUri" website
android:inputType="textEmailAddress" E-mail address
android:inputType="textEmailSubject" email subject
android: inputType = "textShortMessage" SMS
Long android: inputType = "textLongMessage" information
android: inputType = "textPersonName" names
android: inputType = "textPostalAddress" address
android: inputType = "textPassword" password
android:inputType="textVisiblePassword" visible password
android:inputType="textWebEditText" as the text of the web form
android:inputType="textFilter" Text Filter
android:inputType="textPhonetic" Pinyin input // Number type
android: inputType = "number" Numbers
inputType :inputType="numberSigned" signed numeric format
android:inputType="numberDecimal" floating point format with decimal point
android:inputType="phone" Dialing Keyboard
android:inputType="datetime
android:inputType="date" date keyboard
android:inputType="time" Time Keyboard

More about Android control related content interested readers can view the site: "Android control usage summary"

I hope this article is helpful to Android program design.


Related articles: