我正在使用系统覆盖来显示一些内容。但我希望覆盖使背景变暗。我该怎么做?
这就是我想要的:
这就是我得到的方式:
这是我设置叠加层的代码:
overlay = LayoutInflater.from(this).inflate(R.layout.activity_popup_dictionary, null);
final WindowManager.LayoutParams params = new WindowManager.LayoutParams(
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.MATCH_PARENT,
WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY,
WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
PixelFormat.TRANSLUCENT);
params.gravity = Gravity.BOTTOM;
params.x = 0;
params.y = 100;
windowManager = (WindowManager) getSystemService(WINDOW_SERVICE);
windowManager.addView(overlay, params);
largeQ
相关分类