开发者

Override contents of table layout at runtime

I have created a table layout in xml. At runtime, i am using a condition where in first case i am filling table layout. However in second case i am again adding contents to the same layout. And they get added up at the end of lay开发者_StackOverflow中文版out. However i need to clear the previous contents of layout i.e. of first case by contents of second case. Any suggestions ???

Regards


Not sure if it's what you are looking for, but you can use these TableLayout's methods to remove tableRows as needed:

public void removeView (View view)
public void removeViewAt (int index)
public void removeViews (int start, int count)

refer to docs: http://developer.android.com/reference/android/widget/TableLayout.html (these methods are inherited from ViewGroup)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜