Prerak Prerak - 1 year ago 64
Android Question

Table with dynamic number of columns in Android

I want to create a table with dynamic number of columns in android I know how to add rows dynamically using LayoutInflator but how to add columns dynamically?

Thank you for your time any help is highly appreciated.

Answer Source

you dont add columns - only rows and after that you can tell every view how many columns need to span


Defines how many columns this child should span. Must be >= 1. 

Must be an integer value, such as "100". 

This may also be a reference to a resource (in the form "@[package:]type:name") or theme attribute (in the form "?[package:][type:]name") containing a value of this type. 

This corresponds to the global attribute resource symbol layout_span.

one of the best Tuts: