TextView的字体颜色设置的多种方法.docVIP

  • 9
  • 0
  • 约4.21千字
  • 约 4页
  • 2018-02-27 发布于河北
  • 举报
TextView的字体颜色设置的多种方法

TextV?iew的字?体颜色设置?的多种方法? 对于set?TextV?iew(int a)这里的a是?传进去颜色?的值。例如,红色0xf?f0000?是指0xf?f0000?如何直接传?入R.color?.red是没?有办法设置?颜色的,只有通过文?章中的第三?种方法先拿?到资源的颜?色值再传进?去。 tv.setTe?xtCol?or(this.getRe?sourc?es().getCo?lor(R.color?.red)); 关键字: andro?id textv?iew color? TextV?iew的字?体设置方法?: 1、直接通过配?置文件设置? 2、在Acti?vity类?中进行设置? 第一种方式?很简单,用于静态或?初始文字颜?色的设置,方法如下: main.xml Xml代码? ?xml versi?on=1.0 encod?ing=utf-8? Linea?rLayo?ut xmlns?:andro?id=http://schem?as.andro?/apk/res/andro?id andro?id:orien?tatio?n=verti?cal andro?id:layou?t_wid?th=fill_?paren?t andro?id:layou?t_hei?ght=fill_?paren?t

文档评论(0)

1亿VIP精品文档

相关文档