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)
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
    passiontim閱讀 173,558評論 25 708
  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa閱讀 8,925評論 0 6
  • afinalAfinal是一個android的ioc,orm框架 https://github.com/yangf...
    passiontim閱讀 15,569評論 2 45
  • 鐘聲響起,所有的一切畫為句點。沒有那種想象中伸一個懶腰似的輕松,存在著的僅僅是滿空氣的虛無。 這是一種無法...
    HZ新鮮感閱讀 404評論 0 2
  • 看了知乎大神@酸梅干超人的回答文章《從零基礎如何自學 UI 設計?》,我制訂了自己的PS學習以及UI學習計劃。(或...
    柒筱胭閱讀 2,513評論 4 25