I have these text fields which I generated dynamically. But I can\'t seem to set layout parameters for them. Please tell me what I\'m doing wrong.
I\'m able to generate
You have to use TableRow.LayoutParams instead of LinearLayout.LayoutParams
Replace your code
LinearLayout.LayoutParams fieldparams = new LinearLayout.LayoutParams(10, LinearLayout.LayoutParams.WRAP_CONTENT, 1.0f);
with the below code.
TableRow.LayoutParams fieldparams = new TableRow.LayoutParams(10, TableRow.LayoutParams.WRAP_CONTENT, 1.0f);
Its working fine. Let me know what happened. :-)
You are adding Table Row into table so use TableLayout.LayoutParams
instead of LinearLayout.LayoutParams
.As we use LayoutParam according to parent in which we are going to add