How to make a custom dialog transparent?
I need to make my custom dialog tran开发者_运维技巧sparent.
How can I do that?
You can also use following line in constructor
getWindow().setBackgroundDrawable(new ColorDrawable(0));
Hey budy. . . Use the xml file for Background that in Available in the developer site and Set #00000000 as the Background colour thats for the Transperent colour.
To make the background of the Dialog transparent you just need to set the theme of dialog to be android.R.style.Theme_Translucent_NoTitleBar. eg:-
new AlertDialog.Builder(context, android.R.style.Theme_Translucent_NoTitleBar).show();
You can set background color to Color.Transparent
精彩评论