Reputation: 101
Such as ListView
, it invokes smoothScrollToPosition(index)
Android Developer Doc
doesn't have HorizontalListView
. I downloaded this custom HorizontalListView
from GitHub
, but I'm confused about how to use HorizontalListView
on scrolling automatically.
could recyclerview scroll loop, and it scroll in specified time
Upvotes: 1
Views: 60
Reputation: 1078
you can use recycle view and set layout manager as follows
listView= (RecyclerView)findViewById(R.id.hlistview);
LinearLayoutManager layoutManager=new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false);
listView.setLayoutManager(layoutManager);
See this example on github
Upvotes: 0
Reputation: 3994
If you need only a HorizontalListView RecycleView is the way to go.
Just add this line of code to convert it to a HorizontalListView
LinearLayoutManager layoutManager= new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, false);
mRecyclerView = (RecyclerView) findViewById(R.id.recycler_view);
mRecyclerView.setLayoutManager(layoutManager);
Refrence can be found here https://developer.android.com/reference/android/support/v7/widget/RecyclerView.html
Upvotes: 0
Reputation: 1536
I recommend using recyclerview with a linear layout manager that is set in horizontal mode
Upvotes: 2