4

我有像Play商店应用程序这样的要求,其中有带有图像和视频的视图寻呼机并滚动以查看详细信息。不幸的是,当用户滚动时,滚动是跳跃的,但如果我删除滚动视图,视图寻呼机工作得很好。

布局的外观和感觉是这样的 http://cl.ly/MBRB

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"  android:fillViewport="true">

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >



    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="160dp"
        android:background="@drawable/loading_image"
        android:gravity="top"
        android:orientation="vertical" >

        <android.support.v4.view.ViewPager
            android:id="@+id/product_image_pager"
            android:layout_width="fill_parent"
            android:layout_height="match_parent" />

        <com.viewpagerindicator.CirclePageIndicator
            android:id="@+id/titles"
            style="@style/CirclePageIndicator"
            android:layout_alignParentBottom="true"
            android:padding="10dip"
            android:paddingBottom="10dp" />
    </RelativeLayout>

    <include layout="@layout/app_screen_menu" />
</LinearLayout>
</ScrollView>

顺便说一句,我正在从服务器加载图像。

谢谢

4

1 回答 1

6

您正在使用 2 个滚动监听器

  • viewpager 使用滚动监听器
  • 滚动视图使用滚动监听器

这两个滚动监听器正在为滚动事件而战。你可以通过实现来解决这个问题onInterceptTouch。在这种方法中,您可以决定谁赢得了 ScrollEvent 的战斗

看看这个受保护的帖子,关于包含 2 个滚动视图的类似问题

于 2013-01-14T21:16:26.477 回答