■TextView文本框
1.概述:文本框其实就是一个文本显示器,没有文字编辑功能。
width 宽度 setWidth(int)
height 高度 setHeight(int)
gravity 文本对齐方式 setGravity(int)
text 文本内容 setText(...)
textColor 文本颜色 setTextColor(ColorStateList)
textSize 文本字号大小 setTextSize(float)
textStyle 文本字体风格,如粗体/加粗、斜体/倾斜 setTypeface(...)
drawableTop 在文本顶部绘制指定图像 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableBottom 在文本底部绘制指定图像 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableLeft 在文本左边绘制指定图像 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableRight 在文本右边绘制/插入指定 图像/图片 setCompoundDrawablesWitchIntrinsicBounds(...)
drawablePadding 文本与图形的间距 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableEnd 在文本结尾绘制指定图像
drawableStart 在文本开头绘制指定图像
shadowColor 文本阴影颜色 setShadowLayer(float,float,float,int)
shadowDx 文本阴影在水平方向
1.概述:文本框其实就是一个文本显示器,没有文字编辑功能。
2.常用属性:
(1)本类TextView常用:width 宽度 setWidth(int)
height 高度 setHeight(int)
gravity 文本对齐方式 setGravity(int)
text 文本内容 setText(...)
textColor 文本颜色 setTextColor(ColorStateList)
textSize 文本字号大小 setTextSize(float)
textStyle 文本字体风格,如粗体/加粗、斜体/倾斜 setTypeface(...)
drawableTop 在文本顶部绘制指定图像 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableBottom 在文本底部绘制指定图像 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableLeft 在文本左边绘制指定图像 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableRight 在文本右边绘制/插入指定 图像/图片 setCompoundDrawablesWitchIntrinsicBounds(...)
drawablePadding 文本与图形的间距 setCompoundDrawablesWitchIntrinsicBounds(...)
drawableEnd 在文本结尾绘制指定图像
drawableStart 在文本开头绘制指定图像
shadowColor 文本阴影颜色 setShadowLayer(float,float,float,int)
shadowDx 文本阴影在水平方向