解决方法
@H_301_5@ 您可以使用getParent()
获取视图的父级,然后调用
removeView()
.
View yourView = ...; ViewGroup viewParent = (ViewGroup) yourView.getParent(); viewParent.removeView(yourView);
getParent()
获取视图的父级,然后调用
removeView()
.
View yourView = ...; ViewGroup viewParent = (ViewGroup) yourView.getParent(); viewParent.removeView(yourView);