HorizontalScrollView shrinks GridView to small lin

2019-07-08 12:31发布

问题:

When I put a HorizontalScrollView around a GridView, the GridView gets compressed into a small column on the left. The Gridview's vertical scrollbar even appears on the left. The HorizontalScrollView's width is set to fill_parent and the GridView is also fill_parent. I don't know why this is happening.

I tried setting the GridView's visibility to GONE and VISIBILE like someone recommended but it doesn't do anything. However if fastScroll is enabled on the GridView, then dragging the fast scroll tab vertically causes the GridView to expand horizontally and it keeps expanding past the last column.

回答1:

I understand now why this cannot be done. There should be a way to force the GridView to load all horizontal items and allow horizontal scrolling.

The better choice would be for them to implement some kind of DataGrid control. Most people are under the impression that GridView like a DataGrid.