ExamplesFromMyBlog icon indicating copy to clipboard operation
ExamplesFromMyBlog copied to clipboard

你好,我在APSnapView里面放了一个banner,的话会出现rv往上滑动的时候APSnapView没有跟着向上

Open mrchenmo opened this issue 6 years ago • 3 comments

而是rv从APSnapView下面穿过去了,这个怎么办啊

mrchenmo avatar Jun 26 '18 11:06 mrchenmo

需要提供更多信息

kyleduo avatar Jun 29 '18 03:06 kyleduo

@kyleduo <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent">

<com.fumei.smallreading.study.widgets.APHeaderView
    android:id="@+id/alipay_header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <com.fumei.smallreading.study.widgets.APSnapView
        android:id="@+id/alipay_snap"
        android:layout_width="match_parent"
        android:layout_height="100dp">

        <com.youth.banner.Banner xmlns:app="http://schemas.android.com/apk/res-auto"
            android:id="@+id/study_banner"
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:background="@android:color/white"
            app:indicator_drawable_selected="@drawable/indicator_selected"
            app:indicator_drawable_unselected="@drawable/gray_radius"
            app:indicator_height="6dp"
            app:indicator_width="6dp" />

    </com.fumei.smallreading.study.widgets.APSnapView>

    <com.fumei.smallreading.study.widgets.APBarView
        android:id="@+id/alipay_bar"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:background="#2484CF">

        <RelativeLayout
            android:id="@+id/bar2"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="@color/white">

            <TextView
                android:id="@+id/bar2_title"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:text="书房"
                android:textColor="#333333"
                android:textSize="16sp" />

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_marginRight="15dp"
                android:src="@drawable/study_book_search" />
        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/bar1"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:layout_gravity="center"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:background="@drawable/search_bg">

            <ImageView
                android:id="@+id/image_search"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true" />

            <EditText
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_toRightOf="@id/image_search"
                android:background="@null"
                android:hint="面对级大风和" />
        </RelativeLayout>
    </com.fumei.smallreading.study.widgets.APBarView>
</com.fumei.smallreading.study.widgets.APHeaderView>

<android.support.v7.widget.RecyclerView
    android:id="@+id/rv_study_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:overScrollMode="never"
    app:layout_behavior="com.fumei.smallreading.study.widgets.APScrollingBehavior" />

</android.support.design.widget.CoordinatorLayout>

mrchenmo avatar Jul 03 '18 05:07 mrchenmo

@kyleduo 这是我的页面布局,这个banner就是放图片的,出现的问题是:滑动RV很慢的话这个banner会收缩,如果很快的滑动这个rv这个banner不会收缩,rv直接从这个banner下面穿过去,题头也没有变化。代码中也加了LinearLayoutManager和setOnHeaderFlingUnConsumedListener的处理。这个是在Fragment中使用,recyclerview-v7:24.2.1和design:24.2.1的版本。我在你的demo里面是好的,我把rv里面的数据换成模拟数据也不会出现这种情况,不知道咋回事

mrchenmo avatar Jul 03 '18 05:07 mrchenmo