Android GridView Column Stretching
Asked Answered
C

2

1

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

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

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

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

screenshot

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

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

Concoction answered 15/1, 2012 at 21:25 Comment(0)
C
2

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.

Crimpy answered 16/1, 2012 at 2:31 Comment(1)
Unfortunately it looks like you're right, I didn't realize they HAD to be the same width. Making the conversion to a table isn't a pleasant though, but it does look necessary here. Thanks.Concoction
S
1

Try setting wrapContent as TextView width

Strohbehn answered 15/1, 2012 at 21:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.