如何允许Android的PopupWindow滚动 [英] How to allow scrolling in Android's PopupWindow
本文介绍了如何允许Android的PopupWindow滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个填充了一个LinearLayout中一个PopupWindow。我instatiated我的弹出窗口是这样的:
I have a PopupWindow that is populated with a LinearLayout. I instatiated my popup window like this:
PopupWindow pw = new PopupWindow(layout, 450, 700, true);
pw.showAsDropDown(layout, 80, 80);
然而,当设备方向切换为横向,在弹出的窗口被在底部切断,我不能向下滚动。看到屏幕截图:
However, when the device orientation is switched to landscape, the popup window gets cut off at the bottom and I cannot scroll down. See the screen capture:
这个弹出下面的布局的确是滚动的。所以,我怎样才能使弹出滚动?
The layout underneath this popup is indeed scrollable. So how can I make the popup scrollable?
谢谢,
伊戈尔
Thanks, Igor
推荐答案
LinearLayouts不滚动的,所以不是封闭的LinearLayout中的滚动型。
LinearLayouts aren't scrollable, so instead enclose the LinearLayout in a ScrollView.
这篇关于如何允许Android的PopupWindow滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文