1

I need to add a textview in a listview in between listitems. How can i make it possible.

I have a listview with listitems and i would like to add a textview as a separator between a group of listitems list like a group.

Thanks in advance.

arnp
  • 3,178
  • 6
  • 26
  • 43

2 Answers2

0

You should use 2 types of xml files for list items - first for "usual" list item ant second for item with textview. And set them in adapter appropriately.

Artem Chilin
  • 392
  • 2
  • 11
  • Setting them in the adapter is the harder part that I'm struggling at. What layout should I pass to the super function in my list view inflater? The one with text view or the one without it? – cegprakash Feb 07 '17 at 08:56
0

You can have a look at this post. It is basically the same as grouping items with headers except you will have each item with its "header".

Community
  • 1
  • 1
Inon Stelman
  • 955
  • 7
  • 12