how to delete table row in table layout in android

前端 未结 8 2137
耶瑟儿~
耶瑟儿~ 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<View> 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);
    }
    
    0 讨论(0)
  • 2021-02-13 02:10

    I use this:

    tl.removeView(tl.getChildAt(index));
    
    0 讨论(0)
提交回复
热议问题