您的位置:首页 > 移动开发 > Android开发

android之针对fragment多次调用onCreateView的问题

2015-06-03 15:33 447 查看
private View rootView;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (null != rootView) {
ViewGroup parent = (ViewGroup) rootView.getParent();
if (null != parent) {
parent.removeView(rootView);
}
} else {
rootView = inflater.inflate(layoutId, null);
initView(rootView);// 控件初始化
}
return rootView;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: