我需要更改TextView的背景颜色。
使用ColorStateList可以更改字体颜色,但是背景颜色不接受ColorStateList。
lblEtiqueta.setTextColor (new ColorStateList (
new int [] [] {
new int [] {android.R.attr.state_pressed}
new int [] {android.R.attr.state_focused}
new int [0]
}, new int [] {
Color.rgb (255, 128, 192),
Color.rgb (100, 200, 192),
Color.White,
}
));
如何制作背景颜色?
TextView控件在运行时动态创建。
提前感谢。