如何在全屏设置DialogFragment?

时间:2015-12-06 01:03:00

标签: android

我见过类似的问题,但我无法用他们的答案来解决..

此外,我正在使用一个库来显示具有模糊背景效果的DialogFragment。 这是我的代码,如何在全屏设置此对话框。

public class AddBirthday extends DialogFragment {

private BlurDialogFragmentHelper mHelper;

public static AddBirthday newInstance() {
    AddBirthday fragment = new AddBirthday();
    return fragment;
}

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mHelper = new BlurDialogFragmentHelper(this);
    mHelper.onCreate();
}

// implement either onCreateView or onCreateDialog
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View v = inflater.inflate(R.layout.add_birthday, container, false);

    return v;
}

public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mHelper.onActivityCreated();
}

@Override
public void onStart() {
    super.onStart();
    mHelper.onStart();
}

@Override
public void onDismiss(DialogInterface dialog) {
    mHelper.onDismiss();
    super.onDismiss(dialog);
}
}

0 个答案:

没有答案