Android - Custom AlertDialog Background Color

前端 未结 3 1950
忘掉有多难
忘掉有多难 2020-12-10 06:32

So I see we can have alertdialogs with gray and white (when setinverse...) background colors.

To learn why I checked themes.xml of the sdk, checking it I was led to

3条回答
  •  不知归路
    2020-12-10 06:41

    so easy..

    Dialog d=builder2.create();
    ...
    d.show();
    d.getWindow().setBackgroundDrawableResource(R.drawable.mydialog_shape);
    

提交回复
热议问题