Android的GridView控件列拉伸 [英] Android GridView Column Stretching

查看:692
本文介绍了Android的GridView控件列拉伸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用来显示位数行(见图片)。

I have a GridView that is being used to display a number of rows of digits (see picture).

我希望每个行开始,说行n为第n行标题。

I want each row to begin with a heading that says "Row n" for the nth row.

然而,含有行n中的TextView正在由其他数字闭塞。所显示的更多的数字,就越差闭塞。

However, the TextView containing "Row n" is being occluded by the other digits. The more digits being displayed, the worse the occlusion.

我怎样才能让我的行n,以充分显示TextView的?

How can I allow my "Row n" TextView to be displayed in full?

FYI:在GridView的重心:中心,拉伸模式:columnWidth中,高度和宽度都填写父

FYI: The gridview has gravity: center, stretch mode: columnWidth, height and width are fill parent.

包含行nTextView的有重力:LEFT,数字有重力:CENTER_HORIZONTAL

The textview containing "Row n" has gravity: LEFT, the digits have gravity: CENTER_HORIZONTAL

推荐答案

至于同样的问题打交道时,我看得出来,GridView的列必须是相同的宽度。只有这样,才能使整个行n:标签可见是减少列的数量,从而使每一列宽,否则请尝试使用的TableView代替

As far as I could tell when dealing with the same problem, GridView columns must all be the same width. The only way to make the whole "Row n:" label visible would be to reduce the number of columns, thus making each column wider, otherwise try using a TableView instead.

这篇关于Android的GridView控件列拉伸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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