Both scrollable gridviews in android

Is it possible to allow griview to scroll both vertically and horizontally at the same time in android? Please inform.

+4
source share
2 answers

I doubt that it will be possible. GridView is based on an ArrayAdapter, which has only 1 size for elements. How would you arrange them in a view that can be expanded both vertically and horizontally?

Of course, if you just want to make it larger than the screen and use a hard-coded number of rows / columns, you can put it in another scrollable view.

0
source

There are two solutions, and you can use the one that suits your requirements.

  • RecyclerView GridView . . , , . .

  • RecyclerView Grid Layout, .

    <ScrollView>
        <RecyclerView />
    </ScrollView>
    

    GridLayoutManager .

, .

, .

0

Source: https://habr.com/ru/post/1783821/


All Articles