TextView属性小结

TextView属性小结

待改进

属性

  1. android:autoLink:Controls whether links such as urls and email addresses are automatically found and converted to clickable links.[enum]:定义文本中电话、email、url等的超级链接

    Values

    • none:0x00
    • web:0x01
    • email:0x02
    • phone:0x04
    • map:0x08
    • all:0x0f

    Related Methods

    • setAutoLinkMask(int)
  2. android:autoText:If set, specifies that this TextView has a textual input method and automatically corrects some common spelling errors. [boolean]:设置是否具有文本输入功能和文本的纠错功能

    Related Methods

    • setKeyListener(KeyListener)
  3. android:breakStrategy:Break strategy (control over paragraph layout).[enum]

    Values

    • simple:0,Line breaking uses simple strategy.
    • high_quality1,Line breaking uses high-quality strategy, including hyphenation.
    • balanced:2,Line breaking strategy balances line lengths.

    Related Methods

    • setBreakStrategy(int)
  4. android:bufferType:Determines the minimum type that getText() will return.[enum]默认normal

    Values

    • normal:0,Can return any CharSequence, possibly a Spanned one if the source text was Spanned.
    • spannable:1,Can only return Spannable.
    • editable:2,Can only return Spannable and Editable.
  5. android:capitalize:If set, specifies that this TextView has a textual input method and should automatically capitalize what the user types.[enum]默认none:设置有文本输入控件的首字母大写功能

    Values

    • none:0,
    • sentences:1,
    • words:2,
    • characters:3,
  6. android:cursorVisible:Makes the cursor visible (the default) or invisible.[boolean]:设置光标是否显示,默认显示

    Related Methods

    • setCursorVisible(boolean)
  7. android:digits:If set, specifies that this TextView has a numeric input method and that these specific characters are the ones that it will accept.[boolean]:是否只输入数字

    Related Methods

    • setKeyListener(KeyListener)
  8. android:drawableBottom:The drawable to be drawn below the text.:绘制的东西在文本的下方

    Related Methods

    • setCompoundDrawablesWithIntrinsicBounds(int,int,int,int)
  9. android:drawableEnd/Left/Right/Start/Top:

  10. android:drawablePadding:The padding between the drawables and the text.[dimension]:设置图片和文本的间隙

    Related Methods

    • setCompoundDrawablePadding(int)
  11. android:drawableTint:Tint to apply to the compound (left, top, etc.) drawables.

    Related Methods

    • setCompoundDrawableTintList(ColorStateList)
  12. android:drawableTintMode:Blending mode used to apply the compound (left, top, etc.) drawables tint.[enum]

    Values

    • src_over:3,
    • src_in:5,
    • src_atop:9,
    • multiply:14,
    • screen:15,
    • add:16,

    Related Methods

    • setCompoundDrawableTintMode(PorterDuff.Mode)
  13. android:editable:If set, specifies that this TextView has an input method.[boolean]:设置文本控件的输入功能,TextView默认是falseEditView默认是true

  14. android:editorExtras:Reference to an <input-extras> XML resource containing additional data to supply to an input method, which is private to the implementation of the input method.

    Related Methods

    • setInputExtras(int)
  15. android:elegantTextHeight:Elegant text height, especially for less compacted complex script text.[boolean]

    Related Methods

    • setElegantTextHeight(boolean)
  16. android:ellipsize:If set, causes words that are longer than the view is wide to be ellipsized instead of broken in the middle.[enum]如果设置为true文本的长度可以比控件的宽度长

    Vaules

    • none:0,
    • start:1,
    • middle:2,
    • end:3,
    • marquee:4,

    Related Methods

    • setEllipsize(TextUtils.TruncateAt)
  17. android:ems:Makes the TextView be exactly this many ems wide.:控件文字的显示长度

    Related Methods

    • setEms(int)
  18. android:fontFamily:Font family (named by string) for the text.设置文本的字体

    Related Methods

    • setTypeface(Typeface)
  19. android:fontFeatureSettings:Font feature settings.设置字体的风格

    Related Methods

    • setFontFeatureSettings(String)
  20. android:freezesText:If set, the text view will include its current complete text inside of its frozen icicle in addition to meta-data such as the current cursor position.[boolean]:设置保存文本的内容和光标的位置。

    Related Methods

    • setFreezesText(boolean)
  21. android:gravity:Specifies how to align the text by the view's x- and/or y-axis when the text is smaller than the view.[enum]:设置控件中文本的位置

    Related Methods

    • setGravity(int)
  22. android:height:Makes the TextView be exactly this many pixels tall.[dimension] :设置控件高度

    Related Methods

    • setHeight(int)
  23. android:hint:Hint text to display when the text is empty.设置默认的显示文本

    Related Methods

    • setHint(int)
  24. android:hyphenationFrequency:Frequency of automatic hyphenation.[enum]Frequency of automatic hyphenation.:自动断字的频率

    Values

    • none:0,
    • normal:1,Less frequent hyphenation, useful for informal use cases, such as chat messages.
    • full:2,Standard amount of hyphenation, useful for running text and for screens with limited space for text.

    Related Methods

    • setHyphenationFrequency(int)
  25. android:imeActionId:Supply a value for EditorInfo.actionId used when an input method is connected to the text view.[int] :设置IME动作ID,在onEditorAction中捕获判断进行逻辑操作。

    Related Methods

    • setImeActionLabel(CharSequence,int)
  26. android:imeActionLabel:Supply a value for EditorInfo.actionLabel used when an input method is connected to the text view.:设置IME动作标签。

    Related Methods

    • setImeActionLabel(CharSequence,int)
  27. android:imeOptions:Additional features you can enable in an IME associated with an editor to improve the integration with your application.

    Values

    Related Methods

    • setImeOptions(int)
  28. android:includeFontPadding:Leave enough room for ascenders and descenders instead of using the font ascent and descent strictly. [boolena] (Normally true).:设置文本是否要在顶部和底部的留空白

    RelatedFontPadding(boolean)

  29. android:inputMethod:If set, specifies that this TextView should use the specified input method (specified by fully-qualified class name).:设置输入的输入法(需要完限定名)

    Related Methods

    • setKeyListener(KeyListener)
  30. android:inputType:The type of data being placed in a text field, used to help an input method decide how to let the user enter text.[enum] :设置文本的输入股类型

    Values

    Related Methods

    • setRawInputType(int)
  31. android:letterSpacing:Text letter-spacing.

    Related Methods

    • setLetterSpacing(float)
  32. android:lineSpacingExtra:Extra spacing between lines of text.:行间距

    Related Methods

    • setLineSpacing(float,float)
  33. android:lineSpacingMultiplier:Extra spacing between lines of text, as a multiplier.:设置行间距的倍数。

    Related Methods

    • setLineSpacing(float,float)
  34. android:lines:Makes the TextView be exactly this many lines tall.:设置文本显示的行数

    Related Methods

    • setLines(int)
  35. android:linksClickable:If set to false, keeps the movement method from being set to the link movement method even if autoLink causes links to be found.[boolean]:设置文本的链接是否能被点击

    Related Methods

    • setLinksClickable(boolean)
  36. android:marqueeRepeatLimit:The number of times to repeat the marquee animation. Only applied if the TextView has marquee enabled.:跑马灯的次数

    Values

    • marquee_forever

    Related Methods

    • setMarqueeRepeatLimit(int)
  37. android:maxEms:Makes the TextView be at most this many ems wide.:文本的最大显示字数

    Related Methods

    • setMaxEms(int)
  38. android:maxHeight:Makes the TextView be at most this many pixels tall.:设置文本控件的最大高度

    Related Methods

    • setMaxHeight(int)
  39. android:maxLength:Set an input filter to constrain the text length to the specified number.:设置一个文本过滤器,保证文本的最大长度。

    Related Methods

    • setFilters(InputFilter)
  40. android:maxLines:Makes the TextView be at most this many lines tall.:设置文本的最大显示行数

    Related Methods

    • setMaxLines(int)
  41. android:maxWidth:Makes the TextView be at most this many pixels wide.:设置文本的最大宽度

    Related Methods

    • setMaxWidth(int)
  42. android:minEms:Makes the TextView be at least this many ems wide.:设置文本的最小字符长度

    Related Methods

    • setMinEms(int)
  43. android:minHeight:Makes the TextView be at least this many pixels tall.设置文本的最小高度

    Related Methods

    • setMinHeight(int)
  44. android:minLines

  45. android:minWidth

  46. android:numeric:If set, specifies that this TextView has a numeric input method. [boolean] 默认是false:设置数字的输入法

    Values

    • integer:0x01,Input is numeric.
    • signed:0x03,Input is numeric, with sign allowed.
    • decimal:0x05,Input is numeric, with decimals allowed.

    Related Methods

    • setKeyListener(KeyListener)
  47. android:password:Whether the characters of the field are displayed as password dots instead of themselves.[boolean] :设置文本是否以密码的显示输入

    Related Methods

    • setTransformationMethod(TransformationMethod)
  48. android:phoneNumber:If set, specifies that this TextView has a phone number input method. The default is false.[boolean]:设置文本的输入方式为手机号码

    Related Methods

    • setKeyListener(KeyListener)
  49. android:privateImeOptions:An addition content type description to supply to the input method attached to the text view, which is private to the implementation of the input method.

    Related Methods

    • setPrivateImeOptions(String)
  50. android:scrollHorizontally:Whether the text is allowed to be wider than the view (and therefore can be scrolled horizontally).:

    Related Methods

    • setHorizontallyScrglling(boolean)
  51. android:selectAllOnFocus:If the text is selectable, select it all when the view takes focus.[boolean]:如果文本被选中了,让全部文字都选中

    Related Methods

    • setSelectAllOnFoucus(boolean)
  52. android:shadowColor:Place a blurred shadow of text underneath the text, drawn with the specified color. :设置文本控件的阴影颜色。

    Related Methods

    • setShadowLayer(Float,float,float,int)
  53. android:shadowDx:Horizontal offset of the text shadow.:文本阴影的水平偏移量

    Related Methods

    • setShadowLayer(float,float,float,int)
  54. android:shadowDy:Vertical offset of the text shadow.文本阴影的垂直偏移量

    Related Methods

    • setShadowLayer(float,float,float,int)
  55. android:shadowRadius:Blur radius of the text shadow.:阴影的半径

    Related Methods

    • setShadowLayer(float,float,float,int)
  56. android:singleLine:Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key.[boolean]:设置文本控件单行

    Related Methods

    • setTransformationMethod(TransformationMethod)
  57. android:text:Text to display.

    Related Methods

    • setText(CharSequence,TextVIew.BufferType)
  58. android:textAllCaps:Present the text in ALL CAPS. This may use a small-caps form when available.[boolean]:设置文本是否自动转换成大写

    Related Methods

    • setAllCaps(boolean)
  59. android:textAppearance:Base text color, typeface, size, and style.:文本的参数

    Related Methods

    • setTextAppearance(int)
  60. android:textColor:Text color.

    Related Methods

    • setTextColor(int)
  61. android:textColorHighlight:Color of the text selection highlight.:高亮

    Related Methods

    • setHighlightColor(int)
  62. android:textColorHint:Color of the hint text.

    Related Methods

    • setHitTextColor(int)
  63. android:textColorLink:Text color for links.:设置文字链接的颜色

    Related Methods

    • setLinkTextColor(int)
  64. android:textIsSelectable:Indicates that the content of a non-editable text can be selected.[boolean]:设置文本是否能被选中

    Related Methods

    • isTextSelectable()
  65. android:textScaleX:Sets the horizontal scaling factor for the text.

    Related Methods

    • setTextScaleX(float)
  66. android:textSize:Size of the text.

    Related Methods

    • setTextSize(int,float)
  67. android:textStyle:Style (bold, italic, bolditalic) for the text.

    Values

    • normal:0
    • bold:1
    • italic:2

    Related Methods

    • setTypeface(Typeface)
  68. android:typeface:Typeface (normal, sans, serif, monospace) for the text.

    Values

    • normal
    • sans
    • serif
    • monospace

    Related Methods

    • setTypeface(Typeface)
  69. android:widthMakes: the TextView be exactly this many pixels wide.

    Related Methods

    • setWidth(int)
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,265评论 6 490
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,078评论 2 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 156,852评论 0 347
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,408评论 1 283
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,445评论 5 384
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,772评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,921评论 3 406
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,688评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,130评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,467评论 2 325
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,617评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,276评论 4 329
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,882评论 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,740评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,967评论 1 265
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,315评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,486评论 2 348

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 171,749评论 25 707
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 8,855评论 0 6
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,408评论 2 45
  • 钟声响起,所有的一切画为句点。没有那种想象中伸一个懒腰似的轻松,存在着的仅仅是满空气的虚无。 这是一种无法...
    HZ新鲜感阅读 383评论 0 2
  • 看了知乎大神@酸梅干超人的回答文章《从零基础如何自学 UI 设计?》,我制订了自己的PS学习以及UI学习计划。(或...
    柒筱胭阅读 2,481评论 4 25