android WindowManager.LayoutParams y不工作

时间:2016-05-29 12:59:41

标签: java android popupwindow layoutparams

我希望popupwindow下面的背景变暗。但是标记的背景红色矩形也变暗了。这不是我想要的结果。

这是我设置背景的代码:

.split

public void setBackgroundAlpha(float bgAlpha) { Window window = mContext.getWindow(); WindowManager.LayoutParams layoutParams = window.getAttributes(); layoutParams.gravity = Gravity.START | Gravity.TOP; layoutParams.y = mView.getBottom();//mView is the button layoutParams.alpha = bgAlpha; //0.0-1.0 window.setAttributes(layoutParams); } 不起作用。谢谢回答。 the result

0 个答案:

没有答案