1

I am working in android. i wanted to cleara layout each time i press a button and start everything again(as in doing "Reset") . Its not working with the following code.

 final TableLayout rel=(TableLayout)findViewById(R.id.tab1);
int k=rel.getChildCount();
                    System.out.print("k is"+k);
                                for(int x=0;x<k; x++)
                          {
                             View v1 = rel.getChildAt(x);
                            rel.removeView(v1);

                         }      

So i tried to print the value of k and i got it like 0101100 where i expected an integer. Any help is appreciated ..Thank you

4

2 回答 2

0

rel.removeAllViews(); 帮助过我

于 2012-05-17T05:16:39.873 回答
0

为什么不让它不可见

v1.setVisibility(int)
于 2012-05-17T05:20:33.327 回答