给一个android的TextView设置背景颜色动态显示,到那时好像不起作用。我是少了什么东西么?
2013-08-05 13:16
671 查看
试试这个:
我同意颜色和资源应该有相同的样式,但是我也花费了一些时间才找到这个解决方法。
TextView c1= new TextView(activity); c1.setTextColor(getResources().getColor(R.color.solid_red)); c1.setText("My Text");
我同意颜色和资源应该有相同的样式,但是我也花费了一些时间才找到这个解决方法。
相关文章推荐
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- android--设置TextView部分文字的颜色和背景(高亮显示)
- 最新历史版本 :android--设置TextView部分文字的颜色和背景(高亮显示)
- 最新历史版本 :android--设置TextView部分文字的颜色和背景(高亮显示)
- 最新历史版本 :android--设置TextView部分文字的颜色和背景(高亮显示)
- android TextView 设置部分文字背景色和文字颜色
- android TextView控件加背景和字体颜色多状态控制时,部分状态不起作用问题
- ListView 在getView()中设置一个item中的TextView的动态显示出现其它的也显示的bug解决方法
- android 一个TextView设置多种颜色
- [Android开发] 代码code设置9.png/9-patch 图片背景后,此view中的TextView等控件显示不正常(常见于listview中)
- Android通过selector选择器设置Button或者textview的背景颜色,字体颜色
- Android一个TextView设置多种颜色的2种高效方法
- Android中动态设置TextView的颜色
- Android自定义TextView实心圆角颜色背景(动态改变圆角背景颜色)