Android L 无法绘制虚线作为可绘制背景,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="line" >
<stroke
android:dashGap="1dp"
android:dashWidth="1dp"
android:color="#999999" />
<size android:height="1dp" />
</shape>
</item>
</selector>
我还在xml中使用layerType='software'。
请帮忙。
1.视图的高度必须至少为 2dp(或wrap_content
),以便它能够显示,因为笔划被设计为围绕视图,并且在 1dp 中没有空间这样做。
2.向您的 xml 添加宽度:
<stroke
android:width="1dp"
android:dashGap="1dp"
android:dashWidth="1dp"
android:color="#999999" />
<size android:height="1dp"
android:width="1dp"/>
3.Use layerType='software'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)