android 分隔线
1.用View 配置文件
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"
android:layout_marginTop="6dip"/>
2.用ImageView 代码
ListView listView=(ListView)findViewById(android.R.id.list);
ImageView iv=new ImageView(this);
iv.setBackgroundDrawable(getResources().getDrawable(R.drawable.list_divider));
listView.addFooterView(iv);
listView.addVerticalFadingEdgeEnabled(false);
listView.addVerticalScrollBarEnabled(true);
list_divider.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#CCCCCC"
android:centerColor="#999999"
android:endColor="#CCCCCC"
android:height="1px"
android:angle="0" />
</shape>
</item>
</layer-list>
1.用View 配置文件
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="@android:color/darker_gray"
android:layout_marginTop="6dip"/>
2.用ImageView 代码
ListView listView=(ListView)findViewById(android.R.id.list);
ImageView iv=new ImageView(this);
iv.setBackgroundDrawable(getResources().getDrawable(R.drawable.list_divider));
listView.addFooterView(iv);
listView.addVerticalFadingEdgeEnabled(false);
listView.addVerticalScrollBarEnabled(true);
list_divider.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient
android:startColor="#CCCCCC"
android:centerColor="#999999"
android:endColor="#CCCCCC"
android:height="1px"
android:angle="0" />
</shape>
</item>
</layer-list>