Android TextView XML property settings

Source: Internet
Author: User

Android:ems sets the width of the TextView to n characters.
Android:maxems sets the width of the textview to a maximum of n characters. Overwrite EMS option when used with EMS.
Android:minems sets the width of the textview to a minimum of n characters. Overwrite EMS option when used with EMS.
Android:maxlength limit the number of input characters. If set to 5, then only 5 characters/digits/letters can be entered.
Android:lines sets the number of lines of text, two lines are displayed, even if the second row has no data.
Android:maxlines sets the maximum number of lines of text to display, in combination with width or layout_width, beyond the partial wrap, and the number of lines beyond will not be displayed.
Android:minlines sets the minimum number of lines of text, similar to lines.
Android:linespacingextra sets the line spacing.
Android:linespacingmultiplier sets the multiple of line spacing. such as "1.2"
Android:numeric if set, the TextView has a digital input method. The following values are set: Integer positive integer, signed signed integer, decimal with decimal point floating point number.
Android:password with a small dot "." Display text
Android:phonenumber is set as the input for the phone number.

Android:singleline sets the single-line display. If used with Layout_width, when the text cannot be displayed in its entirety, it is followed by "...". such as android:text= "Test_ singleline" android:singleline= "true" android:layout_width= "20DP" will show only "t ...". If you do not set Singleline or set to False, the text wraps automatically


Android:textappearance to set the appearance of text. As "? Android:attr/textappearancelargeinverse" here refers to the system comes with an appearance,? Indicates whether the system has this appearance, otherwise the default appearance is used. The values you can set are as follows: textappearancebutton/textappearanceinverse/textappearancelarge/textappearancelargeinverse/ Textappearancemedium/textappearancemediuminverse/textappearancesmall/textappearancesmallinverse
Android:textcolor Setting text color
Android:textcolorhighlight the background of the selected text, the default is blue
Android:textcolorhint sets the color of the hint text, which is grayed out by default. Used in conjunction with hint.
Android:textcolorlink the color of the text link.
Android:textscalex set the spacing between text, which defaults to 1.0f. See also the TextView.
Android:textsize set text size, recommended unit of measure "SP", such as "15SP"
Android:textstyle set glyph [Bold (bold) 0, Italic (italic) 1, bolditalic (coarse and oblique) 2] You can set one or more, with "|" Separated
Android:typeface Set the text font, must be one of the following constant values: normal 0, sans 1, serif 2, monospace (equal width font) 3]


Android:height Sets the height of the text area, supported by measurement: px (pixels)/dp/sp/in/mm (mm)
Android:maxheight Setting the maximum height of the text area
Android: MinHeight sets the minimum height of the text area
Android:width sets the width of the text area, supports the measurement: px (pixels)/dp/sp/in/mm (mm), and the difference between the layout_width look here.
Android:maxwidth Set the maximum width of the text area
Android:minwidth Set the minimum width for the text area

Related Article

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.