<ListView
android:id="@+id/listview2"
android:layout_width="600dp"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:divider="@color/gray"
android:dividerHeight="1dp"
android:background="@drawable/listview_round_corner_bg"
android:cacheColorHint="#00000000" />
在drawable文件夹中添加listview_round_corner_bg.xml文件,如下:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 这里可以自己设置