1

In an Android application, I set up a TableLayout with 2 rows each row with 2 columns and each cell contains a textview

I set the height of each TextView with the following code:
myTextview1.getLayoutParams().height = val

And the row height for each row changes accordingly

The point is I can't change the row height if I use the same code for table rows in this way:
myRow1.getLayoutParams().height= val

Why?

AndroidHV
  • 369
  • 1
  • 9
  • check this out, i think it solves your problem https://stackoverflow.com/questions/13445980/is-it-possible-to-specify-tablerow-height – abdulwasey20 Feb 16 '19 at 10:52
  • Unfortunately not, the point is I use XML file to set up the table and the get the layoutparms and then set height but in the link the addview is used to add the rows – AndroidHV Feb 16 '19 at 10:57
  • 1
    The height used by a TableRow inside a TableLayout will always be WRAP_CONTENT. See https://developer.android.com/reference/android/widget/TableLayout – user Feb 16 '19 at 11:15

0 Answers0