对话与Android的透明背景 [英] Dialog with transparent background in Android
本文介绍了对话与Android的透明背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何从Android的对话框中去掉黑色背景。 PIC的显示问题。
最后一个对话框对话框=新的对话框(Screen1.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.themechanger);
解决方案
将此code
dialog.getWindow()setBackgroundDrawable(新ColorDrawable(android.graphics.Color.TRANSPARENT))。
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));
这篇关于对话与Android的透明背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文