How to change dialog background color programmatically?

前端 未结 5 1834
栀梦
栀梦 2020-12-08 16:30

I have a main activity where users can change (via preferences) the background colour to their favourite colour. My problem is that I can not change the background colour o

5条回答
  •  执笔经年
    2020-12-08 16:37

    Dialogue background colour

    dialog.getWindow().setBackgroundDrawableResource(R.color.glassblack);
    

    really worked fine for me.

提交回复
热议问题