在 Gallery 等中有一些关于 ScrollViews 的问题,但是我这里有一些完全相反的东西,我找不到任何解决方案。
问题:我在一个 ScrollView 中有多个画廊。画廊的水平滚动工作正常(这里没有改变,只是来自 SDK 的标准画廊类),但 ScrollView 的垂直滚动,对于整个活动没有。看起来画廊正在拦截触摸事件。你能帮我解决这个问题吗?
这是我的布局 xml:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/scrollview_home"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<RelativeLayout
android:id="@+id/layout_home"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
...>
<Button
.../>
<Gallery
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/gallery_..."
android:layout_width="fill_parent"
android:layout_height="wrap_content"
... />
<TextView
... />
</RelativeLayout>//this layout is repeated few times, because I have multiple galleries
</RelativeLayout>
</ScrollView>
谢谢!