0

I have a shape rectangle in my drawable like this

<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:shape="rectangle">
    <corners
        android:radius="2dp"
        android:topRightRadius="0dp"
        android:bottomRightRadius="0dp"
        android:bottomLeftRadius="0dp"/>
    <stroke
        android:width="1dp"
        android:color="@android:color/white"
        />
</shape>

How, can I hide bottom line ?

2 Answers2

1
<?xml version="1.0" encoding="UTF-8"?>
<!-- inset is used to remove border from top, it can remove border from any other side-->
<inset xmlns:android="http://schemas.android.com/apk/res/android"
       android:insetTop="-2dp">
    <shape xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/rectangle">
        <stroke android:width="1dp" android:color="#b7b7b7" />
        <corners android:bottomRightRadius="5dp"  android:bottomLeftRadius="5dp"/>
        <solid android:color="#454444"/>
    </shape>
</inset>
Bartek Lipinski
  • 30,698
  • 10
  • 94
  • 132
Mina George
  • 184
  • 12
0

use this code

<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<!--  the line -->
<item>
    <shape>

        <solid android:color="#yourColor"
            />
    </shape>
</item>
<!-- This is full view -->
<item android:bottom="10dp">
    <shape>

        <solid android:color="#backGroundColor" />
    </shape>
</item>

this will add a 10dp height line at bottom of your view , u can change size of the line with

<item android:bottom="10dp">

and change color too

good luck

M.G.
  • 33
  • 6