1

I am going to manually add one item to the listView but i always want that item to be the last item in the listview because i am already adding items the listView dynamically

here is what i am using to add the items:

tableItems.Add(new TableItem("Test","Test",Resource.Drawable.Icon));
Ash
  • 153
  • 4
  • 15

4 Answers4

0

you should use your custom adapter. In your adapter, create Add method and make the new item as the last item of ArrayObject or another way make sure that method getItem (int position) return the item you had added with position == (arrayObject.size - 1)

ThaiPD
  • 3,503
  • 3
  • 30
  • 48
0

You could probably use listView.setFooterView(footerView); like shown here.

Community
  • 1
  • 1
Filipe Silva
  • 220
  • 4
  • 10
0

You need to add data in your listview adapter and need to notify your adapter. i.e.

  _youAdapter.add("ABC");
    _youAdapter.notifyDataSetChanged();

Your data will add in listview at the end of the list always.

0

Notify your adapter after this line

tableItems.Add(new TableItem("Test","Test",Resource.Drawable.Icon));
mAdapter.notifyDataSetChnaged();

if in any case this not work then directly add item to adapter ie.

mAdapter.Add(new TableItem("Test","Test",Resource.Drawable.Icon)); mAdapter.notifyDataSetChnaged();

Amarjit
  • 4,327
  • 2
  • 34
  • 51