The specified child already has a parent. You must call removeView() on the child's parent first.

来源:互联网 发布:js鼠标滚轮放大图片 编辑:程序博客网 时间:2024/05/29 14:45

报错提示

子View不能有多个父View,必须要通过removeView(view)方法先remove掉才能再使用。

((ViewGroup)view.getParentView()).removeView(view);


特别提醒:removeView方法在View中没有,只能转化成其子类ViewGroup才能使用;



0 0