2016-03-04 64 views
1

你好我試圖用recyclerview添加標題,所以我決定去與物質成分CoordinatorLayout & AppBarLayout然後CollapsingToolbarLayout,Android的摺疊式工具的反彈,同時滾動recyclerview

可是當我起來就變得略微反彈滾動。你能幫我,然後還建議我怎麼可以添加標題爲recyclerview沒有這個apporach,如果有任何好的例子,請分享。

在此先感謝!

<?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" /> 

回答

相關問題