draw line under TextView on Android

后端 未结 4 1707
野性不改
野性不改 2021-02-07 00:05

I have a layout that adds textviews dynamically and i want to divide each textview with a line.

Something like that:

TextView


TextView


<
4条回答
  •  暖寄归人
    2021-02-07 00:43

    This is the simplest and most similar to using the


    tag in HTML:

    Put this in your XML layout where you want the line:

    
    

    This will draw a white line, 1 dp thick, across the screen. If you want it to be a fixed width, just change the layout_width to the dp size you want. Change the background to the HTML color code of your choice.

提交回复
热议问题