how to delete table row in table layout in android

前端 未结 8 2327
感动是毒
感动是毒 2021-02-13 01:28
void init()
{
   intcolumnwidth1 = int_scr_wd*55;
   intcolumnwidth1 = intcolumnwidth1/100;
   for (int i = 0; i < strarr.length-1; i++)
   {
      strinarr = fun1.sp         


        
8条回答
  •  不知归路
    2021-02-13 01:48

    look this code to remove row in table

    private List listViewRow;
    
    if (listViewRow.size() > 0) {
        for (View view : listViewRow) {
            table.removeView(view);
        }
    }
    
    for (int i = 0; i < myList.size(); i++) {
        row.addView((new TextView(context).setText("Teste")), 0);
        row.addView((new TextView(context).setText("Teste")), 1);
        row.addView((new TextView(context).setText("Teste")), 2);
    
        listViewRow.add(row);
        table.addView(row, 1);
    }
    

提交回复
热议问题