对话与Android的透明背景透明、背景、Android

由网友(萝莉刽子手)分享简介:我如何从Android的对话框中去掉黑色背景。 PIC的显示问题。 最后一个对话框对话框=新的对话框(Screen1.this);dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);dialog.setContentView(R.layout.themechan...

我如何从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背景透明

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));

阅读全文

相关推荐

最新文章