views:

34

answers:

2

I have this code:

<ListView
     android:layout_width="wrap_content"
     android:layout_height="wrap_content"
     android:id="@+id/cashItemsList"
     android:cacheColorHint="#00000000"
     android:divider="@drawable/list_divider"></ListView>

where @drawable/list_divide is:

<shape
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="line">
 <stroke
   android:width="1dp"
   android:color="#8F8F8F"
   android:dashWidth="1dp"
   android:dashGap="1dp" />
</shape>

but I don't see any divider.

help?

A: 

From the doc:

file location:

res/drawable/filename.xml

The filename is used as the resource ID.

basically, you'll need to put a file named list_divider.xml in res/drawable/ so you can access it as R.drawable.list_divider; if you can access it that way, then you can use android:divider="@drawable/list_divider" in the XML for ListView.

Lie Ryan
I work with eclipse, so if I hadn't done that, the code wouldn't compile. so, with the file in place, still seems that the list view ignores my custom divider.
oriharel