Add new items to top of list view on Android?

后端 未结 7 1524
梦谈多话
梦谈多话 2020-11-30 03:19

Android has the transcript mode to allow to automatically scroll a list view to the bottom when new data is added to the adapter.

Can this be somehow reversed so tha

7条回答
  •  我在风中等你
    2020-11-30 03:53

    Try to use

    LinkedList items = new LinkedList();
    
    //some fictitious objectList where we're populating data
    for(Object obj : objectList) {
        items.addFirst(obj);
    }
    listAdapter.notifyDataSetChanged();
    
        

    提交回复
    热议问题