How to use Android DialogFragment setStyle ()

I am trying to set Style to my custom dialog that extends the Fragment dialog, the constructor looks like this:

MyCustomDialog() { super(); setStyle(STYLE_NO_FRAME, 0); } 

and I still see the frame around my layout.

Does anyone have any ideas?

+8
source share
3 answers

Try calling onCreate(...) instead, and not in the constructor.

+7
source

According to setStyle() in the DialogFragment documentation :

Invoking this after creating a dialog fragment will have no effect

+6
source

Better override recipient subject

 override fun getTheme(): Int { return R.style.BottomSheetDialogTheme } 
0
source

Source: https://habr.com/ru/post/891085/


All Articles