我使用PopupWindow类创建自定义弹出窗口.
但是当我在main上添加layout_margin(在我的示例中为15dp)时,会有透明的灰色背景.
如何删除透明背景?
请看图片

编辑这里是我的代码
window = new PopupWindow(customTool.getContext());
window.setWidth(WindowManager.LayoutParams.FILL_PARENT);
window.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
window.setTouchable(true);
window.setFocusable(true);
window.setOutsideTouchable(true);
window.setAnimationStyle(R.style.Animations_PopDownMenu_Left);
window.setContentView(customTool);
window.showAtLocation(customTool, Gravity.NO_GRAVITY, 0, 100);
Run Code Online (Sandbox Code Playgroud)
嗯 - 尝试设置弹出对话框尝试yourDiag.setBackgroundDrawable(null);