如何清除一个TableLayout所有行?TableLayout

由网友(逆徒°)分享简介:我知道,这已经被问过,但没有其他答复中曾经帮助过我,所以我会问我自己... I know that this has already been asked before, but none of the other responses have helped me, so I'll ask myself...我想从...

我知道,这已经被问过,但没有其他答复中曾经帮助过我,所以我会问我自己...

I know that this has already been asked before, but none of the other responses have helped me, so I'll ask myself...

我想从一个TableLayout删除我的所有现有行,因为我希望用户能够动态地更新表。其他建议还使用removeAllViews(),这是应该删除所有孩子的意见建议,但是这个删除行从我的其他表在同一的LinearLayout(我有一个具有多个表的线性布局)。

I am trying to delete all my existing rows from a TableLayout because I want the user to be able to update the table dynamically. Other suggestions have recommended using removeAllViews(), which is supposed to remove all child views, however this deletes rows from my other tables in the same LinearLayout (I have a linear layout with multiple tables).

有什么建议?

推荐答案

这听起来像你可能会调用 removeAllViews()对整个的LinearLayout ,而不是特定的 TableLayout 要清除。仔细检查你有一些事情一样:

It sounds like you might be calling removeAllViews() on the whole LinearLayout and not the particular TableLayout you want to clear. Double check you have some thing like:

myLinearLayout.someTableView.removeAllViews()

阅读全文

相关推荐

最新文章