Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border on the left side of the button only

Here is my button_style.xml which i am including with my button. However, I still can't seem to get the border on the left. Can anyone help me here please?

ps - My background should be transparent

<?xml version="1.0" encoding="utf-8"?>
<selector  xmlns:android="http://schemas.android.com/apk/res/android" >
    <layer-list>
            <item android:left="2dp">
                <shape android:shape="rectangle"> 
                    <stroke
                        android:width="1dp"
                        android:color="#999999"/>
                </shape>
        </item>
    </layer-list>

</selector>
like image 764
BurninatorDor Avatar asked Mar 13 '13 06:03

BurninatorDor


People also ask

How do you put a border on only one side in HTML?

If you want to set a border to just one side of the element, use four values (write none to the side you want no border to appear). If you want to set a border to the top and bottom sides, use two values (write none to the second value).

What is border-left in HTML?

The border-left property in CSS is used to set all bottom left properties in one line. It is used to set the width, style, and color of the left border. Syntax: border-left: border-width border-style border-color|initial| inherit; border-left is a shorthand to set the below property values.


1 Answers

Try this

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

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

            <stroke
                android:width="2dp"
                android:color="#FFF" />
        </shape>
    </item>

</layer-list>
like image 143
Yuki Yoshida Avatar answered Sep 23 '22 22:09

Yuki Yoshida