当前位置: 代码迷 >> Android >> 求设置textview的背景色为透明的方法,该如何解决
  详细解决方案

求设置textview的背景色为透明的方法,该如何解决

热度:36   发布时间:2016-05-01 21:13:38.0
求设置textview的背景色为透明的方法
RT,由于我是在textview是动态添加到listview中的,所以不能在xml中设置,我在网上找了很久了,请教大家有这种方法吗?

------解决方案--------------------
setBackgroundColor(new Color().alpha(0));
TextView在你不进行背景颜色设定的时候,默认就是透明的吧。
------解决方案--------------------
setBackgroundColor(0x80000000);
------解决方案--------------------
setBackgroundColor(android.R.color.transparent);

楼上也提供了好几种方法,都试试呗,看哪种可行,试完了顺便告诉大家一声。
  相关解决方案