我有一个关于DialogFragment的问题,为什么创建并从onCreateDialog方法返回的结果对话框成为onCreateView方法中的容器?谢谢
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().setTitle("Register");
rootView = inflater.inflate(R.layout.fragment_dialog_register,container);
initUI();
return rootView;
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog= super.onCreateDialog(savedInstanceState);
dialog.setTitle(getString(R.string.string_register));
return dialog;
}