繁体   English   中英

滚动recyclerview时android折叠的工具栏反弹

[英]android collapsing toolbar bounce while scrolling recyclerview

嗨,我正在尝试使用recyclerview添加标头,所以我决定先使用材料组件CoordinatorLayout&AppBarLayout然后选择CollapsingToolbarLayout,

但是,当我稍微向上滚动时,它会反弹。 您能否请我帮忙,然后也建议我如何在没有此方法的情况下为recyclerview添加标题,如果有任何好的示例,请分享。

提前致谢!

    <?xml version="1.0" encoding="utf-8"?>
   <android.support.design.widget.CoordinatorLayout   xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:wheel="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">


<android.support.design.widget.AppBarLayout
    android:id="@+id/appBarLayout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:expandedTitleMarginEnd="64dp"
        app:expandedTitleMarginStart="48dp"
        app:layout_scrollFlags="scroll|enterAlwaysCollapsed">

        <include
            app:layout_collapseMode="pin"
            layout="@layout/main_lay_header"
             />

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

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


<!--<android.support.v4.widget.SwipeRefreshLayout
    android:id="@+id/refreshDashBoard"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
    -->
    <android.support.v7.widget.RecyclerView
        android:id="@+id/scrollableview"
        android:layout_width="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:layout_height="match_parent"
        android:layout_below="@+id/appbar"
        android:background="@color/sep_color" />
<!--</android.support.v4.widget.SwipeRefreshLayout>-->


<com.pnikosis.materialishprogress.ProgressWheel
    android:id="@+id/progress_wheel"
    android:layout_width="80dp"
    android:layout_height="80dp"
    android:layout_centerHorizontal="true"
    android:layout_gravity="center"
    android:layout_centerVertical="true"
    android:visibility="gone"
    wheel:matProg_barColor="#5588FF"
    wheel:matProg_progressIndeterminate="true" />

<doodleblue.doodleblue.com.widgets.CustomButton
    android:id="@+id/bottomBarText"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:background="#1CD591"
    android:text="Create"
    android:textAllCaps="false"
    android:textColor="@color/white"
    android:textSize="@dimen/text_size_5"
    android:visibility="gone"
    custom:typeface="Brandon_med" />

试试这个链接 希望这对您有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM