侧滑效果,fragment嵌套时遇到错误:The specified child alred has a parent...
2015-02-07 14:53
197 查看
这几天在做一个侧滑菜单的效果,在侧滑点击Fragment多次之后,出现下列错误
解决办法,在 Fragment 的onCreateView方法写成这样
// 用来加载布局
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
<span style="white-space:pre"> </span>// 把之前判断 rootView是否为空的语句去掉就可以了 // if(rootView == null){ rootView = LayoutInflater.from(getActivity()).inflate(R.layout.activity_main,null); // } return rootView; }
相关文章推荐
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- android viewp嵌套Fragment时遇到The specified child already has a parent. You must call removeView()问题的解决
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- Fragment使用时出现错误:he specified child already has a parent. You must call removeView() on the child's p
- 关于viewpager里嵌套fragment报 “The specified child already has a parent”的解决办法
- Fragment+FragmentActivity出现The specified child already has a parent. You must call removeView() on the child's parent first.
- 替换Fragment 报错 The specified child already has a parent. You must call removeView()
- java.lang.IllegalStateException: The specified child already has a parent 错误处理
- android Fragment java.lang.IllegalStateException:The specified child already has a parent.
- bug_ _fragment_“The specified child already has a parent. You must call removeView"的解决以及产生的原因
- The specified child already has a parent错误
- 【错误】The specified child already has a parent.
- The specified child already has a parent错误
- The specified child already has a parent错误解决办法
- 嵌套Fragment的使用及遇到The specified child already has a parent. You must call removeView()问题的解决
- 替换Fragment 报错 The specified child already has a parent. You must call removeView() on the child's pa
- The specified child already has a parent错误
- The specified child already has a parent错误
- The specified child already has a parent..."错误
- 错误:The specified child already has a parent