How to set the theme for DialogFragment

后端 未结 4 1763
暖寄归人
暖寄归人 2021-02-07 02:22

Can someone please explain why this statement works perfectly well:

setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo);

and th

4条回答
  •  滥情空心
    2021-02-07 03:05

    Its probably too late to answer but try using the code in onCreate of the fragment as

    @Override
        public void onCreate(Bundle savedInstanceState) {
            // TODO Auto-generated method stub
            super.onCreate(savedInstanceState);
    
            setStyle(DialogFragment.STYLE_NO_TITLE, R.style.dialog);
        }
    

提交回复
热议问题