I need to implement a list that has some card which scroll horizontally (scroll one item at a time like facebook friend suggestion list).
Asked
Active
Viewed 340 times
0

Umesh Saraswat
- 560
- 1
- 8
- 22
-
2use 'RecyclerView' with horisontal 'LinearLayoutManager' – Gopal Dec 27 '16 at 07:15
-
just use scrollbars horizontal – Divyesh Patel Dec 27 '16 at 07:15
-
Refer to this link:http://stackoverflow.com/a/29648713/7316510 – Sneha Sarkar Dec 27 '16 at 07:21
-
Possible duplicate of [Horizontal ListView in Android?](http://stackoverflow.com/questions/3240331/horizontal-listview-in-android) – Pushpendra Dec 27 '16 at 07:24
2 Answers
0
Use RecyclerView & set layout manager to that like this
recyclerView.setLayoutManager(new LinearLayoutManager(this) {
@Override
public boolean canScrollVertically() {
return false;
}
});
recyclerView.setAdapter(adapter); I hope this will help you.

Srihari
- 2,387
- 9
- 51
- 82
0
for set horizontal RecyclerView use :
LinearLayoutManager mLayoutManager = new LinearLayoutManager(Context, RecyclerView.HORIZONTAL, false);
mRecyclerView.setLayoutManager(mLayoutManager);
and for showing horizontal scrollBar in RecyclerView , in xml layout :
android:scrollbars="horizontal"
and with this line you can set custom scrollBar:
android:scrollbarThumbHorizontal="@drawable/recycler_scroll"

Saeid
- 2,261
- 4
- 27
- 59