【问题标题】:Delete tableRows in tablelayout删除表格布局中的表格行
【发布时间】:2018-03-21 14:40:35
【问题描述】:

我尝试使用以下方法删除 tableLayout 中的行:

  • table.RemoveAllViews()
  • table.RemoveAllViewInLayout()
  • table.RemoveViewAt()

但它没有用。

我的所有行都是动态添加的。

感谢您的帮助。

【问题讨论】:

  • 可以粘贴代码吗?
  • 编辑您的问题以添加其他详细信息,例如您的代码和有关计时器的信息以及发生的情况

标签: android xamarin rows tablelayout dynamically-generated


【解决方案1】:

如果您想清除所有表格,您可以在 for 循环中一一删除表格子项:

int count = table.getChildCount();
for (int i = 0; i < count; i++) {
    View child = table.getChildAt(i);
    table.removeView(child);
}

【讨论】:

    猜你喜欢
    • 2011-07-30
    • 1970-01-01
    • 1970-01-01
    • 2017-12-25
    • 2011-10-28
    • 2013-04-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多