android - CoordinatorLayout not working -
i attempting implement coordinatorlayout
newly announced android design support library , have used following code in xml layout per sample here:
<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="?attr/colorprimary" app:popuptheme="@style/themeoverlay.appcompat.light" app:layout_scrollflags="scroll|enteralways"/> <android.support.design.widget.tablayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="wrap_content"/> </android.support.design.widget.appbarlayout> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" />
however action bar not hide when scroll down view. can't figure out why not working.
edit: far aware appears coordinatorlayout
not work listview/gridview/scrollviews
, works recyclerview
, nestedscrollview
. unfortunately switching 1 of these views not possibility me still looking solution.
i believe need make listview
implement both scrollingview
, nestedscrollingchild
interfaces.
it's not easiest thing, should able if @ recyclerview
's source code. makes use of nestedscrollingchildhelper
, should able same.
Comments
Post a Comment