The EditText property is parsed in depth

  • 2020-05-17 06:28:59
  • OfStack

EditText inherits TextView, so EditText has the property characteristics of TextView. The following part mainly introduces some properties of EditText's unique input method

android:layout_gravity="center_vertical" : sets the display location of the control: the default top, shown here in the center, and bottom

android:hin: Text is a text prompt displayed when it is empty. You can set the color of the prompt message through textColorHint.
android:singleLine: set the single-line input, 1 denier set to true, the text will not automatically wrap.
android:gray="top" : the pointer is at the first position of line 1 in multiple lines. et.setSelection (et.length ()); : adjust the cursor to the last 1 line
android:autoText: automatic spelling help. There is no effect in setting it alone, and other input methods may be needed
android:capitalize: sets the uppercase type. Set the following values: sentences only uppercase the first letter; words is the size of the first letter of each word. Each letter of characters is capitalized.
android:digits: sets which characters are allowed to be entered. Such as "1234567890 + - * / % \ n ()"
android:singleLine: single or multiple lines, whether enter leaves the textbox or adds a new line to the textbox android:numeric: if set, TextView receives numeric input. It has the following value Settings: integer positive integer, signed signed integer, decimal decimal floating point number.
android:inputType: sets the type of text
android:password: password, with a dot ". "to display the text
android:phoneNumber: set to the phone number input mode.
android:editable: sets whether it is editable or not. You can still get the cursor, but you can't type it.
android:autoLink= "all" : set the text hyperlink style when you click on a url, jump to that url
android:textColor = "#ff8c00" : font color
android:textStyle="bold" : font, bold, italic, bolditalic
android:textAlign="center" : EditText does not have this property, but TextView does
android:textColorHighlight="#cccccc" : background color of selected text, blue by default
android:textColorHint="#ffff00" : sets the color of the text of the prompt message, which is gray by default
android:textScaleX="1.5" : controls the space between words
android:typeface="monospace" : font, normal, sans, serif, monospace
android:background=" @null ": spatial background, not used here, means transparent
android:layout_weight="1" : the weight is useful for controlling the size of the control display.
android: textAppearance = "? android:attr/textAppearanceLargeInverse" : text appearance, here is a reference to the system's own 1 appearance,? Indicates whether the system has this look and feel, otherwise use the default look and feel.


Related articles: