Android textview xml Attribute settings

Source: Internet
Author: User

Optional bytes android: EMS sets the TextView width to N characters.
Android: maxems sets the TextView width to a maximum of N characters. Overwrite the EMS option when used with EMS.
Android: minems sets the TextView width to a minimum of N characters. Overwrite the EMS option when used with EMS.
Android: maxLength limits the number of input characters. If it is set to 5, you can enter only five Chinese characters, numbers, and English letters.
Android: lines sets the number of lines of text. If two lines are set, two lines are displayed, even if the second row has no data.
Android: maxLines sets the maximum number of lines displayed in text. It is used in combination with width or layout_width. If the line exceeded is automatically wrapped, the line exceeded is not displayed.
Android: minLines sets the minimum number of lines of text, similar to lines.
Android: lineSpacingExtra.
Android: lineSpacingMultiplier. For example, "1.2"
Android: If numeric is set, the TextView has a digital input method. It has the following values: integer positive integer, signed integer, and decimal floating point number.
Android: the password is displayed as a small dot ".".
Android: Set phoneNumber to the phone number input method.

Android: singleLine sets single row display. If it is used with layout_width, when the text cannot be fully displayed, "…" is used later. . For example, android: text = "test _ singleLine" android: singleLine = "true" android: layout_width = "20dp" only displays "t ...". If singleLine is not set or is set to false, the text will wrap automatically.


Android: textAppearance. Such as "? Android: attr/textAppearanceLargeInverse "refers to the appearance of the system ,? Indicates whether the system has this appearance. Otherwise, the default appearance is used. Configurable values: textAppearanceButton/textAppearanceInverse/textAppearanceLarge/textAppearanceLargeInverse/textAppearanceMedium/combine/textAppearanceSmall/textAppearanceSmallInverse
Android: textColor set text color
Android: the background color of the selected text in textColorHighlight. The default value is blue.
Android: textColorHint sets the text color of the prompt message. The default value is gray. Used with hint.
Android: The color of textColorLink text link.
Android: textScaleX sets the interval between texts. The default value is 1.0f. See TextView.
Android: textSize: Specifies the text size. The recommended measurement unit is "sp", for example, "15sp"
Android: textStyle [bold (bold) 0, italic (italic) 1, bolditalic (bold and oblique) 2] can be set to one or more, separated by "|"
Android: typeface text font, which must be one of the following constant values: normal 0, sans 1, serif 2, monospace (same width font) 3]


Android: height: sets the height of the text area. supported measurement units: px (pixels)/dp/sp/in/mm (millimeters)
Android: maxHeight sets the maximum height of the text area
Android: minHeight: sets the minimum height of the text area.
Android: width: Set the width of the text area. The measurement unit is px (pixel)/dp/sp/in/mm (mm). The difference between the measurement unit and layout_width is shown here.
Android: maxWidth: sets the maximum width of the text area.
Android: minWidth: sets the minimum width of the text area.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.