Skip to content

Instantly share code, notes, and snippets.

@xingstarx
Created May 17, 2018 10:31
Show Gist options
  • Save xingstarx/cf290711b4b3a7774d2a47da54ce75c4 to your computer and use it in GitHub Desktop.
Save xingstarx/cf290711b4b3a7774d2a47da54ce75c4 to your computer and use it in GitHub Desktop.
使用布局创建一个虚线view
<?xml version="1.0" encoding="utf-8"?>
<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>
@xingstarx
Copy link
Author

在具体的layout布局中,可以这样使用

<ImageView
    android:layout_width="match_parent"
    android:layout_height="5dp"
    android:src="@drawable/dotted"
    android:layerType="software" />
shareeditflag

@xingstarx
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment