一、TextView 控件常见的属性
属性名称 描述
android:autoLink
设置是否当文本为 URL 链接/email/电话号
码/map 时,文本显示为可点击的链接。可
选值(none/web/email/phone/map/
all)。这里只有在同时设置 text 时才自动识
别链接,后来输入的无法自动识别。
android:ems
设置 TextView 的宽度为 N 个字符的宽
度。参见 TextView 中此属性的截图
android:
scrollHorizontally
设置文本超出 TextView 的宽度的情况下,
是否出现横拉条。
android:singleLin
e
设置单行显示。如果和 layout_width 一起
使用,当文本不能全部显示时,后面用“…”
来表示。如 android:text="test_
singleLine " android:singleLine="true"
android:layout_width="20dp"将只显示
“t…”。如果不设置 singleLine 或者设置为
false,文本将自动换行
android:textColor
设置文本颜色
android:
textColorLink
文字链接的颜色.
android:textSize
设置文字大小,推荐度量单位”sp”,