How to change color of Android ListView separator line?

前端 未结 9 1587
时光取名叫无心
时光取名叫无心 2020-11-28 00:08

I want to change color of ListView separator line. Any help would be appreciated.

9条回答
  •  -上瘾入骨i
    2020-11-28 01:11

    Or you can code it:

    int[] colors = {0, 0xFFFF0000, 0}; // red for the example
    myList.setDivider(new GradientDrawable(Orientation.RIGHT_LEFT, colors));
    myList.setDividerHeight(1);
    

    Hope it helps

提交回复
热议问题