Create a transparent dialog on top of activity

前端 未结 2 1023
庸人自扰
庸人自扰 2021-02-01 01:49

Background

I\'m trying to put a layer on top of the current activity which would have explanation of what is going on on the current screen, similar to what occurs on

2条回答
  •  心在旅途
    2021-02-01 02:24

    Just change the background color of your Dialog:

    dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    

    Edit:

    This prevents the dim effect:

    dialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
    

提交回复
热议问题