Art*_*tem 4 android android-shape
我想使用制作虚线shape。
这是我的XML:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="line">
<stroke android:color="@color/grey_divider"
android:width="1dip"
android:dashWidth="5dip"
android:dashGap="13dip"/>
</shape>
</item>
</selector>
Run Code Online (Sandbox Code Playgroud)
如何解决?
尝试这个
在drawable中制作一个xml文件。(例如dashed_line.xml)
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="#C7B299"
android:dashWidth="10px"
android:dashGap="10px"
android:width="1dp"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
现在,在您的布局中使用此xml文件。
android:background="@drawable/dashed_line"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1309 次 |
| 最近记录: |