Android设置ListView分隔线边距

Android设置ListView分隔线边距

Use ‘inset‘.....

(list_divider.xml)

<?xml version="1.0" encoding="UTF-8"?>
<inset xmlns:android="http://schemas.android.com/apk/res/android"
    android:insetLeft="50dp"
    android:insetRight="50dp" >

 <shape>
    <solid android:color="@color/orange" />
    <corners android:radius="2.0dip" />
</shape>

</inset>

and in your list view add like this...

<ListView
    android:dividerHeight="2dp"
    android:divider="@drawable/list_divider"
    ...
/>

you can set the inset value as desired...

 

via: http://*.com/questions/14054364/how-to-assign-padding-to-listview-item-divider-line

Android设置ListView分隔线边距,布布扣,bubuko.com

Android设置ListView分隔线边距

上一篇:Android学习总结之WIN上搭建环境


下一篇:【Android 初学】5、控件--ImageView的使用方法