3

I am working on an application that implements the aforementioned property in the TableLayout.

I was wondering could anyone please help me and show me how to do this programmatically and not in the layout file?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user788511
  • 1,726
  • 2
  • 30
  • 52

1 Answers1

11

Checkout for setColumnStretchable (int columnIndex, boolean isStretchable) in the Android Docs.

Makes the given column stretchable or not. When stretchable, a column takes up as much as available space as possible in its row. Calling this method requests a layout operation.

setStretchAllColumns (boolean stretchAllColumns) -

Convenience method to mark all columns as stretchable.

Lalit Poptani
  • 67,150
  • 23
  • 161
  • 242
  • in the xml layout, I set it android:stretchColumns="*" and then I add row to the table programatically but the column don't stretch at all. I also tried setStretchAllColumns(true) but doesn't work at all – Mark Thien Nov 07 '15 at 10:45