enter image description here

How to make such a strip in CardView?

  • Set for TextView (or what is this widget) background with such a strip below? - pavlofff
  • This was advice on how to fix the problem. Let's try this - set the background for this widget with this stripe. How to set the background for the widget . - pavlofff
  • 3
    This picture question should be closed, since the answer to it is useless for the knowledge base, because search engines (so far) do not know how to index the meaning expressed by the picture - aleksandr barakin

2 answers 2

 <View android:layout_width="match_parent" android:layout_height="1dp" android:background="@color/colorGray" /> 

If you need to add layout_margin

    I usually did this, sometimes I paint on the canvas, he even has flags, mb this option is right for you:

    drawable:

     <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:left="-2dp" android:top="-2dp" android:right="-2dp"> <shape android:shape="rectangle"> <solid android:color="@android:color/transparent" /> <stroke android:width="1dp" android:color="@color/divider_color" /> </shape> </item> </layer-list> 

    Further as usual:

     android:background="@drawable/my_divider"