本文介绍了安卓popupwindow浮动父视图外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
而不是解雇一个弹出式的,我想隐藏它关闭屏幕上的位置 - 宽度,-heigt。当我尝试更新弹出关闭屏幕它被停在父视图的边界。如何更新它关闭屏幕或半屏幕外?
Instead of dismissing a popup, I would like to hide it off screen at position -width,-heigt. When I try to update the popup off screen it gets stopped at the bounds of the parent view. How do I update it off screen, or semi offscreen?
View view = LayoutInflater.from(getBaseContext()).inflate(R.layout.mylayout,null);
pop = new PopupWindow(this);
pop.setTouchable(false);
pop.setHeight(200);
pop.setWidth(200);
pop.setContentView(view);
pop.showAtLocation(myparentview, 0, 50, 50);
pop.update(-200,-200,-1,-1);
问题快照:
Snapshot of problem:
推荐答案
我觉得你缺少的是用setClippingEnabled假。什么
I think what you are missing is using the setClippingEnabled with false.
http://developer.android.com/reference/android/widget/PopupWindow.html#setClippingEnabled(boolean)
您应该更新调用之前调用它,这应该让你绘制窗口画面bounderies之外。
You should call it before the update call and this should let you paint the window outside screen bounderies.
这篇关于安卓popupwindow浮动父视图外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!