android - AppBarLayout view becomes blank when FAB(FloatingActionButton) is clicked in coordinator layout -


this problem occurs on android version 4.2.1 , layour works fine on 5.0.2

i using new co-ordinator layout appbarlayout , floatingactionbutton , recycler view

whenever scrollup recyclerview toolbar hides working fine when toolbar hidden , click on fab button , scroll down toolbar view not visible , again click on fab button brings toolbar back.

<android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent">  <android.support.design.widget.appbarlayout     android:id="@+id/appbar"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:theme="@style/themeoverlay.appcompat.dark.actionbar">      <android.support.v7.widget.toolbar         android:id="@+id/toolbar"         android:layout_width="match_parent"         android:layout_height="?attr/actionbarsize"         android:background="@android:color/darker_gray"         app:layout_scrollflags="scroll|enteralways"         app:popuptheme="@style/themeoverlay.appcompat.light" />  </android.support.design.widget.appbarlayout>  <framelayout     android:id="@+id/container"     android:layout_width="match_parent"     android:layout_height="match_parent"     app:layout_behavior="@string/appbar_scrolling_view_behavior" />  <android.support.design.widget.floatingactionbutton     android:id="@+id/fab"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:layout_gravity="end|bottom"     android:layout_margin="@dimen/fab_margin"     android:src="@drawable/ic_done" /> </android.support.design.widget.coordinatorlayout> 

try moving framelayout declaration before appbarlayout. i'm not sure if far know views have layout_behavior attribute should declared before appbarlayout.


Comments