简体   繁体   English

如何在Android中删除scrollview内的所有表布局

[英]How to remove all tablelayout inside scrollview in Android

I have created a dynamic tableLayout inside scrollview1 . 我在tableLayout内创建了一个动态scrollview1 I have a function that needs to clear all the tablelayout . 我有一个需要清除所有tablelayout And the tablelayout has dynamic buttons too. 而且tablelayout也具有动态按钮。 How do I list all tablelayout inside scrollview and remove it? 如何在scrollview列出所有tablelayout scrollview 并将其删除? Maybe by using a getchild function? 也许通过使用getchild函数?

You can remove child views from an Android view by calling removeAllViews() . 您可以通过调用removeAllViews()从Android视图中删除子视图。

For example, if you want to clear your scrollview1 : 例如,如果您想清除您的scrollview1

scrollview1.removeAllViews();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM