Android GridView Column Stretching

I have a GridView that is used to display a series of lines of numbers (see the picture).

I want each line to start with a heading that says "Line n" for the nth line.

However, a TextView containing "String n" is closed by other digits. The more numbers displayed, the worse the occlusion.

How can I fully display the text file "Row n" Text?

screenshot

FYI: the mesh has gravity: center, stretch mode: column width, height and width are parents.

A text representation containing "String n" has gravity: LEFT, numbers have gravity: CENTER_HORIZONTAL

+1
source share
2 answers

As far as I can tell from the same problem, the columns of the GridView should have the same width. The only way to make the "Row n:" shortcut visible is to reduce the number of columns, thereby increasing each column, otherwise try using TableView.

+2
source

Try setting wrapContent as the width of the TextView

+1
source

Source: https://habr.com/ru/post/1439411/


All Articles