ScrollView和PopupWindow不能协同工作的问题
我想建一个比较复杂的弹出菜单,且菜单里面支持scroll。试过popupmenu和alertwindow,都不能作出这样的效果,于是使用PopupWindow 加ScrollView。PopupWindow指定长宽,用showAtLocation显示在某一个位置。
layout里最外层是一个ScrollView,里面是个LinearLayout A,将此LinearLayout A里填充许多TextView或者ImageView。最终没有滚动效果(能看到scrollbar在滚动,不过里面的TextView或者ImageView完全不动)
十分费解。不知道是不是ScrollView和PopupWindow同时使用是不是有问题。
平台是android3.0.
--------------------编程问答-------------------- 你好,我也遇到了这样的问题,
请问解决没有?
q 40076643,我们交流交流 --------------------编程问答-------------------- --------------------编程问答-------------------- <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>
试试这种结构。我是这样使用,并能成功运行;
补充:移动开发 , Android