how to know from adapter if the item of ListView is visible or not?

后端 未结 3 1734
终归单人心
终归单人心 2021-02-19 15:00

I have an adapter that connected to ListView, e.g.

mJournalAdapter = new JournalAdapter();
journalEntryList.setAdapter(mJournalAdapter);

and I

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-19 15:44

    If you know the postion of that item then you can use

    int last = listView1.getLastVisiblePosition();  
    
    int first = listView1.getFirstVisiblePosition();
    

提交回复
热议问题