How to create a DialogFragment without title?

后端 未结 6 1809
时光说笑
时光说笑 2020-11-29 15:50

I\'m creating a DialogFragment to show some help messages regarding my app. Everything works fine besides one thing: There is a black stripe at the top of the window that sh

6条回答
  •  抹茶落季
    2020-11-29 16:04

    Dialog fragment has setStyle method, which should be called before view creation Java Doc. Also style of the dialog can be set with the same method

    public static MyDialogFragment newInstance() {
            MyDialogFragment mDialogFragment = new MyDialogFragment();
            //Set Arguments here if needed for dialog auto recreation on screen rotation
            mDialogFragment.setStyle(DialogFragment.STYLE_NO_TITLE, 0);
            return mDialogFragment;
    }
    

提交回复
热议问题