Full screen DialogFragment

前端 未结 10 2003
执笔经年
执笔经年 2021-02-04 02:26

I am trying to create a DialogFragment with a width of MATCH_PARENT so the dialog is nearly full screen (leaving the padding around the edges for the floating look). I have see

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-04 03:07

    In my code, I was wanting a fullscreen dialog, but still show the notification bar at the top of the screen, so I'm using:

    setStyle(DialogFragment.STYLE_NORMAL, android.R.style.Theme_Black_NoTitleBar);
    

    This makes it fullscreen, but I'm not using a fullscreen style so that I keep the notification bar.

    Hope it helps someone!

提交回复
热议问题