質問

I'm using a ListActivity with an ArrayAdapter. I have an array of Strings, and I want to put a divider after the 5th String in the list. Is there any way to do this? Sorry if there are duplicates, just did not find what I was looking for. Thanks in advance.

役に立ちましたか?

解決

There is a hack.

Add a divider view at last in your list_item's layout file and give it an Id. Now in your custom adapter class,you can set that view's visibility depending on the position whether you want it to be shown or not,in getView() method.

他のヒント

A property of Listview will help you:

android:divider =  (color or drawable)

And also

android:dividerHeight = (integer in dp)
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top