how to delete table row in table layout in android

前端 未结 8 2324
感动是毒
感动是毒 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:59

    I realize this is a old thread but I as shocked when I came across this without a decent answer.

    I do it like this:

    TableLayout table = (TableLayout) findViewById(R.id.myTable);       
    table.removeAllViews();
    

    That will remove all of the child views, in this case rows and everything. It doesn't seem by your description that you want to delete just one row, but that you want to remove them and then load the rows again. The above code will do the removing part.

提交回复
热议问题