how to delete table row in table layout in android

前端 未结 8 2150
耶瑟儿~
耶瑟儿~ 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:02

    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.

提交回复
热议问题