title: View Stroke not working in Android above lollipop
body: <blockquote>
    <p>Have implemented the View to draw the line its working below kitkat version and it's not working in lollipop and Marshmallow devices.</p>
  </blockquote>
  
  <p>Below is my code:</p>
  
  <pre><code> &lt;View
          android:id="@+id/vDottedLine"
          android:layout_width="match_parent"
          android:layout_height="2dp"
          android:layout_marginLeft="@dimen/sixteen_dp_margin"
          android:layout_marginRight="@dimen/sixteen_dp_margin"
          android:background="@drawable/dotted"
          android:layerType="software" /&gt;
  </code></pre>
  
  <blockquote>
    <p>XML file for color</p>
  </blockquote>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;shape xmlns:android="http://schemas.android.com/apk/res/android"
  android:shape="line"&gt;
  &lt;stroke
      android:height="2dp"
      android:color="#000"
      android:dashGap="3dp"
      android:dashWidth="8dp" /&gt;
  
  &lt;/shape&gt;
  </code></pre>
  
  <p>And also tried adding <code>android:layerType="software"</code> and <code>android:hardwareAccelerated="true"
  </code> and false as well. Any hint to overcome this problem?</p>