设置高程时,Android
Popwindow不会显示阴影.它似乎从文档中支持它.我使用5.0棒棒糖.
创建弹出窗口如下所示:
popupWindow = new PopupWindow(context); popupWindow.setOutsideTouchable(true); popupWindow.setFocusable(true); popupWindow.setElevation(10); popupWindow.setContentView(rootView); popupWindow.showAtLocation(anchorView,Gravity.NO_GRAVITY,xPos,yPos);
解决方法
为
answered by an Android developer.
If the inflated view doesn’t have a background set,or the popup
window itself doesn’t have a background set (or has a transparent
background) then you won’t get a shadow.
这是我的情况,似乎是你的,因为你不使用setBackgroundDrawable.
这对我有用
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
我打开了一个新的问题,提示他们更新文档(https://code.google.com/p/android/issues/detail?id=174919)