Edittext inheritance relationship: View --> textview --> edittext.
Edittext has many attributes. Here we will introduce several attributes:
Android: layout_gravity = "center_vertical"
Set the display position of the control: Top by default, which is displayed in the center and bottom.
Android: hint = "enter a number! "
Set the prompt information displayed on the space
Android: Numeric = "integer"
Only integers can be entered. If decimal is used, decimal is used.
Android: singleline = "true"
Set single-line Input. Once set to true, the text will not wrap automatically.
Android: Password = "true"
Set only passwords
Android: textcolor = "# ff8c00"
Font color
Android: textstyle = "bold"
Font, bold, italic, bolditalic
Android: textsize = "20dip"
Size
Android: Capitalize = "characters"
Uppercase/lowercase letters
Android: textalign = "center"
Edittext does not have this attribute, but textview has, center
Android: textcolorhighlight = "# cccccc"
The background color of the selected text. The default color is blue.
Android: textcolorhint = "# FFFF00"
Set the text color of the prompt information. The default color is gray.
Android: textscalex = "1.5"
Control the spacing between words
Android: Typeface = "monospace"
Font, normal, SANS, Serif, monospace
Android: Background = "@ null"
Space background. This field does not exist. It is transparent.
Android: layout_weight = "1"
Weight: controls the status between controls. It is useful when the control controls are displayed.
Android: textappearance = "? Android: ATTR/textappearancelargeinverse"