
Android如何绘制虚线
1个回答
2018-05-27 · 知道合伙人软件行家
关注

展开全部
用shape绘制虚线
真机调试时可能会出现虚线变实线的现象
在manifest文件对应的activity节点中设置
android:hardwareAccelerated="false"
即可
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:width="1dp" android:color="#d3d3d3" android:dashWidth="10dp" android:dashGap="10dp" /></shape>
width:线段的高度
color:线段的颜色
dashWidth:线段宽度
dashGap:线段之间间隔宽度
真机调试时可能会出现虚线变实线的现象
在manifest文件对应的activity节点中设置
android:hardwareAccelerated="false"
即可
<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:width="1dp" android:color="#d3d3d3" android:dashWidth="10dp" android:dashGap="10dp" /></shape>
width:线段的高度
color:线段的颜色
dashWidth:线段宽度
dashGap:线段之间间隔宽度
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询