The following code on api 21 shows the outline of a rectangle with a black border of 1 px width:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1dp" android:color="#000000" />
<size android:width="300dp" android:height="50dp"/>
</shape>
However, on api 16 I'm seeing a solid black rectangle. Why is this and is there a workaround?
Edit: in the logcat I'm seeing continuous messages of:
HardwareRenderer﹕ draw surface is valid dirty= Rect(107, 214 - 109, 251)
I had the same problem few weeks ago. I finally added a transparent solid. Try with:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke android:width="1dp" android:color="#000000" />
<size android:width="300dp" android:height="50dp"/>
<solid android:color="@android:color/transparent" />
</shape>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With