使用前必须要把组件与其父组件的关系断开,比如有一个组件的名称为scrollChildLayout,则可以使用下面的代码进行分离

((ViewGroup)scrollChildLayout.getParent()).removeView(scrollChildLayout);
view.addView(scrollChildLayout);

 程序猿必读

posted on 2017-01-05 17:58  龙种人  阅读(373)  评论(0)    收藏  举报