首先Popupwindow和alertDialog是经常拿来比较的,其区别在于Popupwindow是阻塞的,alertDialog是不阻塞的,看情况适时的选用。
首先说怎么实现Popupwindow弹出时和alertDialog一样的边缘背景半透明的效果,实现方法如下:
在Popupwindow要显示之前设置窗体透明度
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.alpha = 0.5f;
get
首先Popupwindow和alertDialog是经常拿来比较的,其区别在于Popupwindow是阻塞的,alertDialog是不阻塞的,看情况适时的选用。
首先说怎么实现Popupwindow弹出时和alertDialog一样的边缘背景半透明的效果,实现方法如下:
在Popupwindow要显示之前设置窗体透明度
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.alpha = 0.5f;
get