Created
March 28, 2012 19:55
-
-
Save JonathanNye/2229968 to your computer and use it in GitHub Desktop.
Simple bottom "stroke" XML drawable for Android View backgrounds
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- This produces a 1.5dp stroke along the bottom of a View. It works by drawing the stroke color as the background of the View, then the background color on top, offset up by 1.5dp. Unfortunately, this approach | |
only works if you have solid color backgrounds. For transparency, you'll have to use a 9patch. --> | |
<?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="STROKE_COLOR_HERE"/> | |
</shape> | |
</item> | |
<item android:bottom="1.5dp"> | |
<shape android:shape="rectangle"> | |
<solid android:color="BACKGROUND_COLOR_HERE"/> | |
</shape> | |
</item> | |
</layer-list> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfect. Thank you