I have a little tweak in my application: my Listview is placed between 2 LinearLayout that looks like my ListView rows.

That's a little trick that allows me to always display first and last item

and my layout looks like

[LinearLayout]

[ListView]

[LinearLayout]

I am pretty happy with the result except for one thing: I would like to insert the listview divider between those LinearLayouts and the ListView.

How should I get a drawable (or better, a xml layout) that would looks exactly like the divider?

有帮助吗?

解决方案

You can use ListView.getDivider() to get the drawable used by a list view according to Android SDK version and theme.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top