使用android:shape="line"画一条线

<View
android:id="@+id/v01"
android:layout_width="match_parent"
android:layout_height="10dp"
android:layout_marginTop="10dp"
android:background="@drawable/line_shape" />
line_shape.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">
<stroke android:width="5dp" android:color="@android:color/black"
/>
</shape>
网友评论