在 drawable 添加 line.xml
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="@android:color/black" /> <!-- 分割线的高度 --> <size android:height="3dip" /> </shape>
在linerlayout
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:divider="@drawable/line" android:orientation="vertical" android:showDividers="middle">