【背景】
Android中ListView,想要将之前add进入的chind view清除掉。
【解决过程】
1.自己先去找了下,是否有clearAll的函数,然后发现,默认的是有类似的功能,但是有些没实现:
removeAllViews()
而有些又暂时不太建议用:public void removeAllViewsInLayout ()
Called by a ViewGroup subclass to remove child views from itself, when it must first know its size on screen before it can calculate how many child views it will render. An example is a Gallery or a ListView, which may "have" 50 children, but actually only render the number of children that can currently fit inside the object on screen. Do not call this method unless you are extending ViewGroup and understand the view measuring and layout pipeline.
所以,还是去网上找找吧。
2.搜:
android list