0

我有一種使用協調器佈局來顯示一個AppBarLayout和再循環器視圖像這樣的片段:協調員佈局滾動標誌來自動顯示在到達頂部時

enter image description here

佈局文件是迄今:

<?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" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical"> 

    <android.support.design.widget.AppBarLayout 
     android:layout_width="wrap_content" 
     app:elevation="4dp" 
     android:layout_height="wrap_content"> 

     <RelativeLayout 
      xmlns:android="http://schemas.android.com/apk/res/android" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_scrollFlags="scroll|snap"> 

      <!-->Content removed<--> 

     </RelativeLayout> 

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

    <android.support.v7.widget.RecyclerView 
     android:id="@+id/fragment_recyclerView" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_behavior="@string/appbar_scrolling_view_behavior"/> 

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

我遇到的問題是,如果我甩回收視圖,使列表滾動一路頂部,AppBarLayout不露,除非我特意再次拉低。是否有一個滾動標誌使AppBarLayout在回收視圖到達頂部時下降,就好像它連接到回收視圖中的第一個項目一樣?

回答

1

不,傳輸慣性是一個known issue通常嵌套滾動,都與平臺API和CoordinatorLayout使用的。

+0

這實在令人失望:/ – Helios