我使用PopupWindow类创建自定义弹出窗口。
但是,当我在主界面上添加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);