簡體   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