您的位置:首页 > 移动开发 > Android开发

TextView

2016-05-15 15:13 453 查看
extends View

implements ViewTreeObserver.OnPreDrawListener

Konwn Direct Subclasses

Button EditText,

XML属性

android:autoLink setAutonLinkMask(int) 文本为可点击的连接,可选值(none/email/web/phone/map/all)

android:autoText setKeyListener(KeyListener) 自动执行输入值的拼写纠正

android:drawableBottom/Left/Right/End/Start/Top 图片在文本的上下左右位置

setCompoundDrawablesWithIntrinsicBounds(int,int,int,int)

android:drawablePadding. 设置text与图片的间隔,可设置为负数。和上一个属性一同使用。

android:ellipsize 文本过长时超过view的宽度,控件如何显示。values有:start,end,marquee

android:marqueeRepeatLimit 在ellipsize指定marquee的情况下,设置重复滚动的次数。values:marpuee_forever

android:ems 设置textview的宽度为N个字符的宽度

android:maxEms 设置最长为N个字符的宽度

android:lines 设置文本的行数 。

android:max/min Lines 设置文本行数的最大,最小

android:text 设置显示文本

android:gravity 设置文本内容以及光标位置

android:hint Text为空时显示的文字提示信息。可通过textColorHint设置提示信息的颜色

android:textColor 设置文本显示颜色

android:textSize 设置文字大小 单位 sp

android:textStyle 设置字形 属性value:bold粗体,italic斜体。可通过 | 来设置多个

android:height 设置文本区域的高度

android:maxHeight android:minHeight 设置文本区域的最大/小高度

android:width 设置文本区域的宽度

android:maxWidth android:minWidth 设置文本区域的最大/小宽度
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android textview