开发者

How to make a custom dialog transparent?

开发者 https://www.devze.com 2023-02-23 06:32 出处:网络
I need to make my custom dialog tran开发者_运维技巧sparent. How can I do that?You can also use following line in constructor

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

精彩评论

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

关注公众号