5

実際には2つの問題があります。CoordinatorLayout内のRecyclerViewでスクロールが正しく動作しない

です。スクロールが正しく動作しない場合があります。特定の方向に非常に小さな距離をスクロールしてタッチを離した場合、その特定の方向の終わり、つまり上下にスクロールします。

2nd。私は、そのが崩壊し、その拡張時にタイトルが

を非表示にする必要があります。ここXMLコードが

<android.support.design.widget.CoordinatorLayout 
android:id="@+id/rootLayout" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
> 

<android.support.design.widget.AppBarLayout 
    android:layout_width="match_parent" 
    android:layout_height="256dp" 
    android:id="@+id/appBarLayout" 
    > 

    <android.support.design.widget.CollapsingToolbarLayout 
     android:id="@+id/collapsingToolbarLayout" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     app:layout_scrollFlags="scroll|exitUntilCollapsed" 
     app:contentScrim="?attr/colorPrimary" 
     android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
     android:clickable="true" 
     android:foreground="?android:attr/selectableItemBackground" 
     > 

     <ImageView 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:src="@drawable/imageone" 
      app:layout_collapseMode="parallax" 
      app:layout_collapseParallaxMultiplier="0.7" 
      android:scaleType="fitCenter" 
      /> 

     <android.support.v7.widget.Toolbar 
      android:id="@+id/toolbar22" 
      android:layout_width="match_parent" 
      android:layout_height="?attr/actionBarSize" 
      app:popupTheme="@style/ThemeOverlay.AppCompat.Light" 
      app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" 
      app:layout_collapseMode="pin" 
      /> 

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

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

<android.support.v7.widget.RecyclerView 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:id="@+id/recyclerview1" 
    android:layout_centerHorizontal="true" 
    app:layout_behavior="@string/appbar_scrolling_view_behavior" 
    android:layout_marginTop="-30dp" 
    android:layout_marginLeft="3dp" 
    android:layout_marginRight="3dp" 
    /> 

<android.support.design.widget.FloatingActionButton 
    android:id="@+id/fabBtn" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    app:layout_anchor="@id/appBarLayout" 
    app:layout_anchorGravity="bottom|right|end" 
    android:src="@drawable/ic_favourite" 
    android:layout_marginBottom="@dimen/fab_margin_bottom" 
    android:layout_marginRight="@dimen/fab_margin_right" 

    app:fabSize="normal" /> 

enter image description here

+0

アクティビティ(フラグメント)コードはどこにありますか? – iamthevoid

+0

あなたは、このための解決策を見つけるために管理しました。私は同様の問題に直面している。 – Gaurav

+0

@Gauravいいえ。私はこの問題に直面したときrecyclerviewとコーディネーターのレイアウトを使用して停止しました。今日、私は再び更新されたSDK、まだ同じ問題でそれを試してみました。代わりに、私はこれらの日[ObservableScrollView](https://github.com/ksoichiro/Android-ObservableScrollView) –

答えて

0

//だ場合にのみ、カスタムツールバーのタイトルが示すことにしたいですツールバーが&が

崩壊拡張したときのタイトルを示す&を隠しますちょうどあなたのRecyclerViewにこの属性を設定しRecyclerViewの悪いスクロール動作を削除するには

:最初の問題を解決するには、以下の通りであるKuldeepによって与えられた答えに加え

0

android:nestedScrollingEnabled="false" 

かこれを動的に行うには、以下を使用できます。

recyclerView.setNestedScrollingEnabled(false); 
関連する問題