我有一个简单的PopupWindow,我使用以下代码创建(代码在C#中,Java代码应该基本相同)
View popupView = LayoutInflater.From(this.Activity).Inflate(Resource.Layout.LectionFooter,null);
var popup = new PopupWindow(popupView,ViewGroup.LayoutParams.MatchParent,ViewGroup.LayoutParams.WrapContent,false)
{
OutsideTouchable = true,AnimationStyle = Resource.Style.FooterAnimation
};
popup.SetBackgroundDrawable(new BitmapDrawable());
popup.ShowAtLocation(rootView,GravityFlags.Bottom,0);
在pre-Lollipop设备上,这个弹出窗口看起来不错,但在Android 5.0上,弹出窗口与软按钮重叠:
这是Android 4.4设备上的PopupWindow:
有谁知道为什么会发生这种情况以及如何解决这个问题?