Question

Hey guys I have this code for a border:

 <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:bottom="-10dp"
        android:left="-10dp"
        android:right="0dp"
        android:top="-10dp"
        android:color="@android:color/transparent">
        <shape android:shape="rectangle" >
            <stroke
                android:width="5dp"
                android:color="#191A18" />
        </shape>
    </item>

</layer-list>

and I wanted a border that would be transparent everywhere else except it would have a bar on the right most edge.

However instead what I get is a huge black rectangle which fills the linear layout...

Was it helpful?

Solution

This code worked:

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

    <item
        android:bottom="-10dp"
        android:left="-10dp"
        android:top="-10dp">
        <shape android:shape="rectangle" >
            <solid android:color="@android:color/transparent" />

            <stroke
                android:width="3dp"
                android:color="#ff000000" />
        </shape>
    </item>

</layer-list>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top