Textview is one of our most commonly used components. It is mainly used to display text content. I believe you are very familiar with it, therefore, common attributes (such as setting the font size, color, text location, and so on) are not described here. The following lists the interesting attributes of textview, which I hope will help you.
1. Set click link
Android: autolink
This attribute is used to set whether the text is displayed as a clickable link when the text is URL link, email, phone number, or map. Optional values: none (common text, default value)/Web (URL, click to open the page)/email (email, click to send an email)/phone (phone number, click Open dialing Interface)/MAP/All.
Android: linksclickable
Set whether to click the connection even if autolink is set.
Android: textcolorlink
Set the text link color.
2. Set drawable (image)
Android: drawableleft, Android: drawableright, Android: drawabletop, Android: drawablebottom
Output A drawable on the left, right, top, and bottom of the text.
Android: drawablepadding
Set the interval between text and drawable. It can be used with drawableleft, drawableright, drawabletop, and drawablebottom. It can be set to negative.
3. Set the width
Android: EMS, Android: minems, Android: maxems
Set textview width, minimum width, and maximum width. Unit: character (that is, width of n characters ).
4. Set the number of rows
Android: singleline
Set single row display.
Android: lines, Android: minlines, Android: maxlines
Set the number of lines of text, the minimum number of lines, and the maximum number of lines. Set the two lines to display two lines, even if the second row has no data.
5. Set row spacing
Android: linespacingextra
Set the line spacing.
Android: linespacingmultiplier
Set the line spacing multiple
6. Set shadow
Android: shadowcolor
Specifies the color of the text shadow, which must be used with shadowradius.
Android: shadowradius
Set the shadow radius. If it is set to 0.1, it becomes the font color. Generally, it is better to set it to 3.0.
Android: shadowdx, Android: shadowdy
Set the horizontal and vertical coordinates of the shadow.
7. Set ultra-long display
Android: ellipsize
Set how to display the control when the text is too long. The following settings are available: start -- ellipsis is displayed at the beginning; end -- ellipsis is displayed at the end; middle -- ellipsis is displayed in the middle; marquee -- is displayed in the form of a marquee (horizontal animation Movement)