Andy
Andy

Reputation: 10830

How to add text to an empty GridLayout in Android?

TextView has setText(String), but when looking on the Doc, I don't see one for GridLayout. Is there an adapter or something that I need to use instead? If so, which one? Thanks in advance for any of the help.

Upvotes: 0

Views: 1635

Answers (1)

C. Leung
C. Leung

Reputation: 6318

GridLayout is a ViewGroup, to which you can only add views; if you want to make a calendar, it would be better to use a GridView.

for the GridView, create an adapter which extends BaseAdapter, and use TextView for the grid's layout. here is an example.

Upvotes: 1

Related Questions