[英]How to allow scrolling in Android's PopupWindow
我有一个用LinearLayout填充的PopupWindow。 我像这样设置了我的弹出窗口:
PopupWindow pw = new PopupWindow(layout, 450, 700, true);
pw.showAsDropDown(layout, 80, 80);
但是,当设备方向切换为横向时,弹出窗口的底部被切断,我无法向下滚动。 参见屏幕截图:
此弹出窗口下面的布局确实是可滚动的。 那么如何使弹出窗口可滚动?
谢谢,伊戈尔
我用这个做,并工作:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layout_popup"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#444444">
</RelativeLayout>
</ScrollView>
</LinearLayout>
希望对您有用。 再见
LinearLayouts不可滚动,因此请将LinearLayout封装在ScrollView中 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.