How to change `solid color` from the code?

前端 未结 2 1360
忘了有多久
忘了有多久 2021-01-03 16:24

I have a Shape defined in xml. Now I need to change a solid color from the code, could you please advice how?



        
2条回答
  •  甜味超标
    2021-01-03 16:57

    I met the problem when I set the background of the item(in the listview)the shape defined in xml, I've got ClassCastException when I invoke the convertview's getBackground() method, but when I invoke the item's outest view's getBackground() method,the Exception disappear, the problem resolved.

提交回复
热议问题