DialogFragment fullscreen shows padding on sides

后端 未结 11 1603
囚心锁ツ
囚心锁ツ 2020-12-05 00:22

I am creating a custom DialogFragment that is displayed underneath the actionbar. So far everything works great. The layout parameters for dialog fragment are match_pa

11条回答
  •  死守一世寂寞
    2020-12-05 00:47

    I figured it out using custom dialog theme. windowIsFloating true will get rid of the background but will add some extra space underneath the background as a background. In which case you can use windowBackground @null to erase it.

    
    

    Usage:

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.CustomDialog);
    

    Thank you to Raghunandan who gave me the link that includes all style attributes. It took me a while but I went through that file and found very interesting elements. Definitely have a look at the link posted below to explore theme styles.

    https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/res/res/values/themes.xml

提交回复
热议问题