Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GridView with horizontal scroll

I currently have a GridView scrolling vertically, and everything works fine. But now that I want to change my layout and have the gridview grow on its width instead of height as it grows bigger I am lost.

I have tried to simply change the column width each time an item is added to the gridview. But no vertical scroll appears, even though the items are added correctly. Is there a neat way to fix this, or must I make my own gridview? :(

Cheers,

like image 541
pgsandstrom Avatar asked Jun 08 '10 13:06

pgsandstrom


People also ask

How do I scroll horizontally using GridView?

You can try putting the GridView in a HorizontalScrollView . You may try to set fixed height to the GridView inside the HorizontalScrollView . Then you can dynamically calculate the number of columns of the GridView based on your content and use setNumColumns(int) method to set it. Great idea!

How can show horizontal scrollbar in GridView in ASP NET?

Just wrap the GridView with a div having overflow style defined, i.e. use div to have scrollbars inside the GridView. You can change overflow:auto to overflow:scroll but that will always show both scrollbars.

How do I scroll GridView horizontally in flutter?

You may want to change the scroll direction when the GridView is displayed in landscape mode. Setting scrollDirection to Axis. horizontal will do just that.


1 Answers

But now that I want to change my layout and have the gridview grow on its width instead of height as it grows bigger

I do not believe GridView supports that -- sorry!

like image 189
CommonsWare Avatar answered Oct 01 '22 15:10

CommonsWare