如何拉伸它TextView
以使其填充整个TableRow
高度?这是我现在得到的截图,
我想TextView
用TableRow
.
这是我创建行的方式:
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));