0

我是 Android 开发人员。点击加号按钮时,我需要多一行。

对于 Ex(编辑联系人我们单击加号表示再添加一行,减号表示删除该行。只需给我 xml 布局和示例编码。)

4

1 回答 1

0

为按钮创建一个 onClickListener()。然后通过引用您的 tableLayout

tblLayout = (TableLayout)findViewById(R.id.tableLayout);

然后使用

TableRow = new TableRow(this);    
//Do something with this row
row.setText("...");

//add the row to the tblLayout
tblLayout.addView(row);
于 2013-02-22T13:11:44.820 回答