问题
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?
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
回答1:
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.
回答2:
Try setting wrapContent as TextView width
来源:https://stackoverflow.com/questions/8873488/android-gridview-column-stretching