I have an activity with a coloured background and a button which is the same colour which I want to minimally show with a white outline.
I used this answer to make a border on a button and it works just fine for me on Nexus 4 and 5 running 4.4.4
I try it on a Samsung S2 running 4.0.3 and the entire button turns black. No border. The button should be same colour as the activity with a white border. Text colour on the button (white) is just fine
Here is my border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="3dp" />
<stroke
android:width="1px"
android:color="#ffffff" />
</shape>
Can anyone explain the different behaviour, and more importantly tell me how to fix it?
Thanks
Edit Well I don't have a real answer, but I think I'm going to fix it by adding in
<solid android:color="@color/mycolor" />
To my drawable shape. I think this works, but it's not very elegant if I want to have a transparent background. I may try setting the color to transparent at some point (on the assumption that some phones/versions of Android default to a black background and this is that easy to change), but no time for it now.