Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Android 开发人员。点击加号按钮时,我需要多一行。
对于 Ex(编辑联系人我们单击加号表示再添加一行,减号表示删除该行。只需给我 xml 布局和示例编码。)
为按钮创建一个 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);