How to set Transparent Background as a Custom Dialog Box in android

前端 未结 8 1058
梦谈多话
梦谈多话 2021-02-02 17:52

I need to make my custom dialog box as a transparent.

Sample Code :

Dialog dialog;
@Override
protected Dialog onCreateDialog(int id) 
{ 
    switch(id) 
         


        
8条回答
  •  借酒劲吻你
    2021-02-02 18:23

    Try this,

    layout.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
    

    add the code above after this line.

    View layout = inflater.inflate( R.layout.about_page, ( ViewGroup ) findViewById( R.id.about_Root ) );
    

提交回复
热议问题