How to show an activity indicator at the end of a ListView in React-Native?

Posted by Ramesh Singh | Updated on

If you want to show an activity indicator at the end of a ListView in React-Native? You should be able to achieve that by using the onEndReached prop for A ListView. When you reach the end you can render the loader. In my case I used renderFooter to render the loader at the bottom of the list. In my scenario

You can set in the component state an attribute called messagesLoading that you set to true when you start fetching new data and to false when done. Based on that, you can display or not the loading indicator in the footer.

This example partial implementation should give you an idea of how you can do it:

Reference:
https://stackoverflow.com/questions/37210984/show-an-activity-indicator-at-the-end-of-a-listview-in-react-native


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers