由网友(萝莉刽子手)分享简介:我如何从Android的对话框中去掉黑色背景。 PIC的显示问题。 最后一个对话框对话框=新的对话框(Screen1.this);dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);dialog.setContentView(R.layout.themechan...![Android 设置Dialog背景透明](https://p.xsw88.cn/allimgs/daicuo/20230911/4131.png)
我如何从Android的对话框中去掉黑色背景。 PIC的显示问题。
最后一个对话框对话框=新的对话框(Screen1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.themechanger);
解决方案
将此code
dialog.getWindow()setBackgroundDrawable(新ColorDrawable(android.graphics.Color.TRANSPARENT))。
![Android 设置Dialog背景透明](https://p.xsw88.cn/allimgs/daicuo/20230911/4131.png)
How do I remove the black background from a dialog box in Android. The pic shows the problem.
final Dialog dialog = new Dialog(Screen1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.themechanger);
解决方案
Add this code
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
相关推荐
最新文章