Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android ScrollView Vs ListView

I´m facing the implementation of a View where I have to load perhaps almost 100 items in a list. I have a doubt in which maybe the best way to implement it. I already know that ListView recycles the views and ScrollView keeps all in memory. The point is that I was thinking in apply paging to the Scrollview to avoid huge loading times when the app inflates all items.

Applications as Google+, Facebook, twitter or Linkedin, Do you think they use ListView?

Thanks

like image 417
Jose M Lechon Avatar asked Jan 25 '14 08:01

Jose M Lechon


1 Answers

ListView is definitely the way to go. It's easier to use than ScrollView, and a paging system doesn't fit in with the style of android.

ListView is meant to create a list of varrying lengths based of an array of information. ScrollView is for having a (usually) set amount of children in the View (defined in the layout xml).

ListViews do not inflate all items, they inflate however many can fit on a page at a time. Your fastest option, with or without paging is a ListView. However, if each child is completeley different, then ScrollView is the way to go.

like image 98
Kylelem62 Avatar answered Oct 05 '22 14:10

Kylelem62