AndroidUI

TextView属性小结

2016-02-25  本文已影响1916人  Passon_Fang

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)
上一篇下一篇

猜你喜欢

热点阅读