Android perception (18): edit the EditText box
The EditText edit box is inherited from TextView. Most TextView methods are applicable and are used to accept user input.
The inputType attribute can be used to specify the input type. There are many acceptable parameters:
Android: inputType = "none" -- enter common characters
Android: inputType = "text" -- enter common characters
Android: inputType = "textCapCharacters" -- enter common characters
Android: inputType = "textCapWords" -- size of the first letter of a word
Android: inputType = "textCapSentences" -- only the size of the first letter
Android: inputType = "textAutoCorrect" -- the first two are automatically completed.
Android: inputType = "textAutoComplete" -- the first two are automatically completed.
Android: inputType = "textMultiLine" -- multiline Input
Android: inputType = "textImeMultiLine" -- multiple input methods (not necessarily supported)
Android: inputType = "textNoSuggestions" -- no prompt
Android: inputType = "textUri" -- URI format
Android: inputType = "textEmailAddress" -- email address format
Android: inputType = "textEmailSubject" -- Subject format
Android: inputType = "textreceivmessage" -- Short Message format
Android: inputType = "textLongMessage" -- long message format
Android: inputType = "textPersonName" -- name format
Android: inputType = "textPostalAddress" -- Postal format
Android: inputType = "textPassword" -- password format
Android: inputType = "textVisiblePassword" -- visible password format
Android: inputType = "textWebEditText" -- as the text format of a webpage form
Android: inputType = "textFilter" -- text filter format
Android: inputType = "textPhonetic" -- Pinyin input format
Android: inputType = "number" -- digit format
Android: inputType = "numberSigned" -- signed numeric format
Android: inputType = "numberDecimal" -- floating point format with decimal point
Android: inputType = "phone" -- dial-up keyboard
Android: inputType = "datetime"
Android: inputType = "date" -- date keyboard
Android: inputType = "time" -- time keyboard
The EditText component derives two subclasses:
AutoCompleteTextView: The EditText with auto-completion. Like the search bar of the browser, it must be used with the Adapter.
ExtractEditText: Not a UI component, it is the underlying service class of the EditText component and is responsible for providing full-screen input support.