StickyHeaderScrollView
StickyHeaderScrollView copied to clipboard
布局中有banner,当滑动到最底部的时候,viewpager内的fragment布局过几秒后会自动往回顶是什么问题呢?
在Activity中正常,在fragment中就会出现这个问题.布局是这样的:
<com.kongnan.headerscrollview.HeaderScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.gxhy.oct.StickyLinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tl_home"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@android:color/holo_red_dark"
android:gravity="center_vertical"
android:text="吸顶View-2"
android:textColor="@color/black"
android:textSize="22sp"
app:isSticky="true" />
<com.to.aboomy.pager2banner.Banner
android:id="@+id/banner_home"
android:layout_width="match_parent"
android:layout_height="160dp" />
<com.flyco.tablayout.SlidingTabLayout2
android:id="@+id/stl_home"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
app:isSticky="true"
app:layout_constraintTop_toTopOf="parent"
app:tl_indicator_color="#BE9B54"
app:tl_indicator_width="20dp"
app:tl_tab_space_equal="true"
app:tl_textBold="SELECT"
app:tl_textSelectColor="#BE9B54"
app:tl_textUnselectColor="#999999"
app:tl_textsize="15sp" />
</com.gxhy.oct.StickyLinearLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_home"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</com.kongnan.headerscrollview.HeaderScrollView>
你可以提个Pull Request上来,我有时间帮你看看。