I am trying to make a drawable to use for a button. I would like it to have this coloring, with a 2px border around it.
Everything works just fine except I cannot get the border to show up...
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<gradient android:startColor="@color/bar_clicked_dark"
android:endColor="@color/bar_clicked_light"
android:angle="90"/>
<corners android:bottomLeftRadius="0dp"
android:topLeftRadius="15dp"
android:bottomRightRadius="15dp"
android:topRightRadius="0dp" />
<stroke android:width="2px"
color="#ff00ffff" />
</shape>
We can add drawable .xml like below
It looks like you forgot the prefix on the color attribute. Try
If you want make a border in a shape xml. You need to use:
For the external border,you need to use:
For the internal background,you need to use:
If you want to set corners,you need to use:
If you want a padding betwen border and the internal elements,you need to use:
Here is a shape xml example using the above items. It works for me