1

I'm trying to make a line shape in Android. It works fine in all Android versions except API 21.

<?xml version="1.0" encoding="utf-8"?>

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">

<size
    android:height="3px"
    android:width="10px" />
<stroke android:color="@color/brightPurple" />

Onik
  • 19,396
  • 14
  • 68
  • 91
mnagy
  • 1,085
  • 1
  • 17
  • 36

1 Answers1

1

Set a non-zero stroke width.

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line">
    <size
        android:height="3px"
        android:width="10px" />
    <stroke
        android:color="@color/brightPurple"
        android:width="1dp" />
</shape>
alanv
  • 23,966
  • 4
  • 93
  • 80