A
A
Andrey Mikhalev2018-02-06 04:57:09
Android
Andrey Mikhalev, 2018-02-06 04:57:09

RecyclerView fastscroll how to make fixed size slider?

I use com.android.support:recyclerview-v7:26.1.0 , which added fastscroll, but there is one drawback: unlike ListView, in RecyclerView the height of the slider dynamically changes depending on the number of items.
For me, when the number of items in the list is more than 50, the slider becomes 1 pixel high, and it cannot be captured by touch. When the number of elements is more than 200, the slider generally becomes less than 1 pixel high, and it is not possible to see it at all.
Slider:

<item>
        <shape>
            <size
                android:height="10dp"
                android:width="10dp"/>
            <solid android:color="@color/colorPrimary" />
        </shape>
</item>

Here I tried to specify a fixed size, but in fact only the width of the slider changes. The height of the slider is ignored.
If the slider is made through the picture, then the application crashes on startup.
How to set fixed slider size in RecyclerView?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question