Android - How to show a vertical line on the background of a ListView (and according to row height)?

后端 未结 4 720
伪装坚强ぢ
伪装坚强ぢ 2021-02-01 09:18

How to show a vertical line on the background, such as the one highlighted in blue on the image below?

\"enter

4条回答
  •  攒了一身酷
    2021-02-01 10:13

    Now verified answer

    your image in item layout:

    
    
        
    
    
    

    three bg nine patch images for drawable top blank fill content bottom blank

    Handling in Adapter:

        if(position==0)
            holder.rl.setBackgroundResource(R.drawable.b);
        if(position==(getCount()-1))
            holder.rl.setBackgroundResource(R.drawable.t);
    

    Finaly got output:

    enter image description here enter image description here

提交回复
热议问题