をスクロールするとき、私はグーグルでAndroidアプリをマップなどの検索バーを実装しよう:Androidのツールバーの標高
リサイクルビューが初期状態にあるときは、ツールバーは何の標高を持っていません。ユーザーがスクロールを開始したときにのみ、標高が表示されます。検索バー(ツールバー)が崩壊することはありません。ここで私はこれを再現しようとしたものです:
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
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.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="64dp">
<!-- content -->
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</android.support.design.widget.CoordinatorLayout>
そして、ここであなたが結果を確認できます。だから私の解決策の問題は、ツールバーの上昇が常に表示されていること、である
を。しかし、私はそれがリサイクルビューがその背後にスクロールするときだけ現れるようにしたい。 Googleマップのアプリに見られるような動作を可能にするデザインサポートライブラリはありますか?
私は私のフラグメントでRecyclerViewを持って
com.android.support:appcompat-v7:23.2.0
com.android.support:design:23.2.0
CollapsingToolbarLayoutを使用してみましたか? –