I am working on the Simple demo of Horizontal RecyclerView.
I want to display scrollbar along with the recyclerview. So I have added android:scrollbars="horizontal"
and android:scrollbarSize="5dp"
in XML.
I am able to get the Scrollbar but it is showing on the bottom. What I want to achieve is to show it on Top. I have found some questions like this but none of them are for horizontal recyclerView + top side scrollbar.
Here is the code which I have tried so far:
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:isScrollContainer="false"
android:orientation="horizontal"
android:scrollbars="horizontal"
android:scrollbarSize="5dp"
android:visibility="visible" />
Thanks!
I have searched couple of hours but not found anything as per your requirement. But there are some trikes or do with some hacky code we can get output as per your requirement.
Set your RecyclerView as below in your xml file.
Put your data in revers order in your List or ArrayList because we need to rotate the recyclerviews so when we rotate it then our data will be display as an ASEC order.
Now last, In your adapter please rotate your all view in revers direction like below.
If you do code as above then your item and its output look like this OutPut
Please make sure to doing this kind of code because android will not responsible for this kind of code, but as per your requirement you can do like this.