我该如何拉伸
我希望
以下是我创建行的方式:
TextView
以使其填满整个TableRow
高度? 这是我现在得到的截图,
![](https://istack.dev59.com/kdSED.webp)
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));