1

I have dotted_line_horizontal.xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="line" >
    <stroke
        android:dashGap="10px"
        android:dashWidth="10px"
        android:color="#5c5c5c" />

</shape>

And I'm using this as a background:

   <View
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@drawable/dotted_line_horizontal" />

When I set android:targetSdkVersion="8" everything is fine, I can see dotted line. When I change to android:targetSdkVersion="17" my dotted line becomes a line. Why?

AppiDevo
  • 3,195
  • 3
  • 33
  • 51

1 Answers1

0

Add a <solid> tag, as specified in this answer.

<solid android:color="#ffffff" />

This will ensure that the dash part isn't the same color as the empty part.

Community
  • 1
  • 1
PearsonArtPhoto
  • 38,970
  • 17
  • 111
  • 142