,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>
上面的图片来自android studio中的预览。当图像在模拟器中显示时,它显示单行而不是虚线。我该如何解决这个问题?
答案 0 :(得分:1)
将此行添加到ImageView
布局
xml
android:layerType="software"