开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜