How to change the background color around a DialogFragment?

前端 未结 8 1862
时光取名叫无心
时光取名叫无心 2020-11-29 01:59

I\'m building a custom DialogFragment. The dialog layout is set to my_dialog.xml, but how can I modify the color around the dialog (the transparent

8条回答
  •  天命终不由人
    2020-11-29 02:37

    change your Text Background on the XML i just edited your code replace it with yours

    
    
    
    

    because you gave the TextView height and width of 100dp. and set a background for it that will fill the whole dialog. since your main layout is wrap_content. please do accept the answer if that helped you.
    Edit : to change the background just add to your layout or to your textview android:background="#232323" you can change these number to any color you like. or you can set a background from the drawable like android:background="@drawable/yourpicturename"

提交回复
热议问题