Horizontal listview is special view in Android. In the part, developers need other library to implement horizontal listview.
Currently we only need RecyclerView, it is a library of Android SDK. Moreover, it is very easy to use.
How to use
- Add RecyclerView library to project
- Sample code of Android
You can see detail of sample code in this link of Android website
- How to draw horizontal listview
After two above steps, we need to config to draw horizontal listview.
LinearLayoutManager layoutManager = new LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false); this.recyclerView.setLayoutManager(layoutManager);
In summary, RecyclerView is a new library to replace ListView, GridView, or StaggeredGridView. We don’t need to use other library to implement above views. RecyclerView is powerful and lightweight library for Android developer.