我经历了不同的例子,但我无法找到我的要求的确切答案。下面是我的代码。让我知道我哪里出错了。
TableLayout tableLayout = (TableLayout) findViewById(R.id.tableLayout);
TableRow tableRow = new TableRow(this);
TableLayout.LayoutParams params=
new TableLayout.LayoutParams
(TableLayout.LayoutParams.MATCH_PARENT,TableLayout.LayoutParams.WRAP_CONTENT);
params.setMargins(20,20, 20, 5);
tableRow.setLayoutParams(params);
tableLayout.addView(tableRow, new TableLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
谢谢..,