如何在android中设置gridview的列宽? [英] How to set a column width of a gridview in android?

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

问题描述

我在android中使用gridview,我想设置第一列的宽度,但我不能。而我正试图找到我遇到的问题的答案,您可以看到下面的评论。我的问题是,下面的描述真的是真的吗?

i'm using gridview in android and i want to set the first column's width but i could not. while i am trying to find the answer to the problem i came face to face with a comment as you can see below. My question is that is description below really true?

GridView中的所有列具有相同的大小。
在星期六,五月23,2009 at 9:25 PM,solid写道:

All columns in a GridView have the same size. On Sat, May 23, 2009 at 9:25 PM, solid wrote:


我无法控制
中列的大小网格视图。第一列只有3-4个字符,其他4列
是5-8个字符。出于某种原因,所有列的宽度都是相同的,
在第一列之后留下大量间距,并将
文本包装在其他列中。有没有办法,我可以在网格视图中设置
个别列的宽度?在理想的世界中,gridview
将像html表一样工作,其中较小的列缩小到
适合数据,而较大的列可根据需要展开。任何想法都会对
有帮助。

I am having trouble controlling the size of the columns in my GridView. The first column is only 3-4 chars and the other 4 columns are 5-8 chars. For some reason, all the columns are the same width, leaving a huge amount of spacing after the first column and wrapping the text inside the others. Is there a way, I can set the width of individual columns in the grid view? In an ideal world, gridview would work like an html table, where the smaller columns are shrunk to fit the data and larger columns expand as necessary. Any ideas would be helpful.


推荐答案

似乎您可能会更好地使用 TableLayout

Seems you may be better of using a TableLayout

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

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