How to stretch a TextView to fill the entire height of a TableRow ? Here is a screenshot of what I'm getting right now,

I want the TextView expand using TableRow .
This is how I create the line:
row = new TableRow(this); desc = new TextView(this); desc.setBackgroundResource(R.drawable.borders); desc.setTypeface(Typeface.SERIF, Typeface.BOLD); desc.setText("Production Date"); desc.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT)); String date = gendataObj.getString("date"); text = new TextView(this); text.setBackgroundResource(R.drawable.borders); text.setText(date); text.setGravity(Gravity.LEFT); text.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT)); row.addView(desc); row.addView(text); table.addView(row, new TableLayout.LayoutParams( TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
source share