【发布时间】:2014-06-20 23:13:05
【问题描述】:
我在代码中动态创建了TableRows,我想为这些TableRows 设置边距。
我的TableRows创建如下:
// Create a TableRow and give it an ID
TableRow tr = new TableRow(this);
tr.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
Button btnManageGroupsSubscriptions = new Button(this);
btnManageGroupsSubscriptions.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, 40));
tr.addView(btnManageGroupsSubscriptions);
contactsManagementTable.addView(tr);
如何动态设置这些边距?
【问题讨论】:
标签: android