给一个android的TextView设置背景颜色动态显示,到那时好像不起作用。我是少了什么东西么?
TextView et = new TextView(activity);
et.setText("350");
et.setBackgroundColor(R.color.white);
I also have this file (colors.xml) in my res/values folder
在我的res/values文件夹中还有这个文件(colors.xml)
<resources>
<color name="white">#ffffffff</color>
<color name="black">#ff000000</color>
</resources>
而且,设置文本的颜色引起了TextView消失。
TextView c1 = new TextView(activity);
c1.setTextColor(R.color.solid_red);
c1.setText("My Text");