1
我已經通過不同的例子,但我無法找到我的要求確切的答案。以下是我的代碼。讓我知道我錯了哪裏。setMargins()不工作tableRow設置邊距
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));
謝謝..,
沒有ü添加的TableRow您tableLayout ???? –