Android Toolbar disappear during scrolling with Coordinatorlayout -
a strange thing happened when try implement toolbar coordinatorlayout
.
- everything seems ok when scroll down , scroll
toolbar
show correctly
- however after scroll down level screen became
the xml below, idea of it, thanks?
<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.support.v7.widget.recyclerview android:id="@+id/list" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" /> <android.support.design.widget.appbarlayout android:id="@+id/appbar" 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="?attr/actionbarsize" android:background="?attr/colorprimary" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:layout_scrollflags="scroll|enteralways" /> </android.support.design.widget.appbarlayout>
place blank view below toolbar
before appbarlayout
closing statement. worked me when had problem.
<android.support.design.widget.appbarlayout android:id="@+id/appbar" 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="?attr/actionbarsize" android:background="?attr/colorprimary" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:layout_scrollflags="scroll|enteralways" /> <view android:id="@+id/appbar_bottom" android:layout_width="match_parent" android:layout_height="1dp" android:background="@android:color/transparent" android:visibility="invisible" /> </android.support.design.widget.appbarlayout>
Comments
Post a Comment