Styling custom dialog fragment not working

后端 未结 4 531
忘了有多久
忘了有多久 2021-02-06 14:13

I\'m trying to style all my dialog fragments to look the same in my app. The dialogs coming from my settings fragment are styled exactly the way I want it. For my custom dialo

4条回答
  •  渐次进展
    2021-02-06 15:15

    I believe you need to set the theme on the actual Dialog and not the Fragment

    Use this constructor to create your AlertDialog:

    AlertDialog.Builder(Context context, int theme)
    

    ie

    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), theme)
    

提交回复
热议问题