私のアプリではAppBarLayout
とToolbar
をサポートアクションバーとして使用しています。ユーザーがコンテンツをスクロールしているときに表示/非表示にしたいKitKatではすべてうまく動作しますが、LollipopとMarshmallowのツールバーは完全な高さをスクロールしていません。 Screen with toolbar fully scrolledAndroidのツールバーは完全に隠されていません(> Lollipop)
マイレイアウト:
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="(...)">
<include
android:id="@+id/app__content"
layout="@layout/app_bar__main"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<fragment android:id="@+id/navigation_drawer"
android:layout_width="@dimen/navigation_drawer_width"
android:layout_height="match_parent"
android:layout_gravity="left"
android:fitsSystemWindows="true"
android:name="(...)"
tools:layout="@layout/fragment__navigation_drawer" />
</android.support.v4.widget.DrawerLayout>
app_bar__main.xml
:
<?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:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="(...)">
<android.support.design.widget.AppBarLayout
android:id="@+id/app__appbarlayout__action_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/app__toolbar"
android:layout_width="match_parent"
android:layout_height="@dimen/action_bar__height"
android:background="@drawable/toolbar__background"
android:elevation="4dp"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay"
tools:ignore="UnusedAttribute" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/app_content__main" />
<include android:id="@+id/app__layout__bottom_bar"
layout="@layout/layout__bottom_bar" />
</android.support.design.widget.CoordinatorLayout>
app_content__main.xml
はちょうど私がフラグメントを追加していたにでframeLayoutです。 support:appcompat-v7:23.3.0
とsupport:design:23.2.0
を使用しています(ツールバーに別のバグがあるため23.3.0を使用できません)。 23.0.0で動作していましたが、以前のバージョンに移行せずに動作させる方法はありますか?