how to delete table row in table layout in android

前端 未结 8 2135
耶瑟儿~
耶瑟儿~ 2021-02-13 01:04
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 02:03

    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);
    }
    

提交回复
热议问题