![]() ![]() ![]() The ViewHolder pattern is not enforced by ListView.Items in a ListView can be arranged, displayed and scrolled in a vertical list only, whereas RecyclerView’s LayoutManager can create both vertical and horizontal lists (and diagonal lists if you care to implement that). Only vertical scrolling is allowed in ListView.This might seem intuitively correct, however it is more work for the ListView, compared to the RecyclerView, which requires a LayoutManager. Some of the issues experienced with ListView, which RecyclerView is designed to solve include: The ListView was created in such a way that Views that are no longer needed (possibly when the user has scrolled away) can be reused to display other items in the list as necessary. Since the total number of items in a list can be arbitrarily large, it would be impractical to inflate the layout for each list item immediately the ListView is created. Each item in the list is displayed in an identical manner, and this is achieved by defining a single layout file that is inflated for each list item. The ListView (and RecyclerView) are android widgets that can hold (and display) a collection of items. RecyclerView is a modern, properly planned and more efficient improvement on the ListView. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |