HorizontalScrollView 将 GridView 缩小为小行
当我将 HorizontalScrollView 放在 GridView 周围时,GridView 会被压缩到左侧的一个小列中。 Gridview 的垂直滚动条甚至出现在左侧。 HorizontalScrollView 的宽度设置为 fill_parent,GridView 的宽度也设置为 fill_parent。我不知道为什么会发生这种情况。
我尝试像有人推荐的那样将 GridView 的可见性设置为 GONE 和 VISIBILE,但它没有执行任何操作。但是,如果在 GridView 上启用了快速滚动,则垂直拖动快速滚动选项卡会导致 GridView 水平扩展,并且它会不断扩展超过最后一列。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我现在明白为什么不能这样做了。应该有一种方法可以强制 GridView 加载所有水平项目并允许水平滚动。
对他们来说更好的选择是实现某种 DataGrid 控件。大多数人的印象是 GridView 就像 DataGrid。
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.