android - Xml drawable not showing correctly in app -


i created xml drawable a part image

and xml

    <layer-list xmlns:android="http://schemas.android.com/apk/res/android">      <item android:top="5dp">         <shape             android:dither="true"             android:shape="rectangle">             <solid android:color="@color/cardview_light_background" />         </shape>     </item>      <item         android:gravity="top"         android:top="2dp">         <shape android:shape="line">             <size android:height="2dp" />             <stroke                 android:width="1dp"                 android:color="@color/coloraccent"                 android:dashgap="48dp"                 android:dashwidth="@dimen/activity_default_margin" />         </shape>     </item>      <item         android:gravity="top"         android:left="32dp"         android:top="2dp">         <shape android:shape="line">             <size android:height="2dp" />             <stroke                 android:width="1dp"                 android:color="#f9607d"                 android:dashgap="48dp"                 android:dashwidth="@dimen/activity_default_margin" />         </shape>     </item>  </layer-list> 

the image above preview in android studio. when image displayed in emulator shows single line instead of dashed lines. how can fix issue?

add line imageview in xml layout

android:layertype="software" 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -