Skip to content

Instantly share code, notes, and snippets.

@CiTuX
Last active June 21, 2023 03:51
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save CiTuX/5031751 to your computer and use it in GitHub Desktop.
Save CiTuX/5031751 to your computer and use it in GitHub Desktop.
Android xml drawable with a bottom stroke
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:top="-6dp"
android:left="-6dp"
android:right="-6dp"
android:bottom="0dp">
<shape android:shape="rectangle">
<solid android:color="#88FFFF00"/>
<stroke
android:width="5dp"
android:color="#FF000000"/>
</shape>
</item>
</layer-list>
@remylavergne
Copy link

Works as intended. Thank you!

@vadiole
Copy link

vadiole commented Apr 17, 2022

shorter version

<?xml version="1.0" encoding="utf-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetLeft="-6dp"
    android:insetTop="-6dp"
    android:insetRight="-6dp"
    android:insetBottom="0dp">
    <shape android:shape="rectangle">
        <solid android:color="#88FFFF00" />
        <stroke
            android:width="5dp"
            android:color="#FF000000" />
    </shape>
</inset>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment