如何在android gridView中设置固定数量的行? [英] How to set a fixed number of rows in android gridView?

查看:22
本文介绍了如何在android gridView中设置固定数量的行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 android 中创建一个具有 10 行和 10 列的 gridView.如何在 Gridview 中设置固定数量的行?

I am trying to create one gridView in android which have 10 rows and 10 columns.How can I set a fixed number of rows in Gridview ?

推荐答案

GridView 并不是真正为此目的而设计的,它旨在以有效的滚动方式显示无限量的数据.如果您想创建一个静态布局,您可以在其中将项目离散地放置在特定位置,您应该查看 GridLayoutTableLayout.

GridView is not really designed for this purpose, it is designed to display an indefinite amount of data in an efficient scrolling manner. If you want to create a static layout where you can discretely place items at specific locations, you should be looking at GridLayout or TableLayout instead.

这篇关于如何在android gridView中设置固定数量的行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆