我需要这样的事情:
制作透明对话框,以便从中可以看到背景。任何人都可以帮忙吗?
答案 0 :(得分:1)
试试这个
Dialog mDialog = new Dialog(mContext, android.R.style.Theme_Translucent_NoTitleBar_Fullscreen);
答案 1 :(得分:0)
尝试以下代码: -
final Dialog dialog = new Dialog(Activity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.xml);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));]
Button cancel = (Button) dialog.findViewById(R.id.cancel);
// if button is clicked, close the custom dialog
ok.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
// stuff
}
});