Android ListView background colors always showing grey

前端 未结 6 1011
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-04 23:27

I have a ListView that I\'m populating from a custom ListAdapter. Inside the Adapter (in the getView(int, View, ViewGroup) method) I\'m setting the background color of the V

6条回答
  •  北荒
    北荒 (楼主)
    2021-01-05 00:11

    You should use: setBackgroundResource(R.color.myRow_red) instead of setBackgroundColor(). In your example background color is assigned with the ID instead of the actual color described in the resources.

提交回复
热议问题