2013-02-22 26 views
0

我是Android開發人員。點擊加號按鈕時,我需要再多一行。添加一行

對於防爆(編輯聯繫人我們單擊加手段增加了一個行,負號表示刪除row.Just給我的XML佈局和我的樣品編碼。)

回答

0

爲按鈕創建一個onClickListener()。然後通過

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

引用您的tableLayout然後使用

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

//add the row to the tblLayout 
tblLayout.addView(row); 
+0

你能給我XML? – Durga 2013-02-25 13:35:14