android - How to stick Tabs with Collapsing ToolBar Layout and TabLayout below ToolBar -
i having collapsing toolbarlayout tablayout, working fine except tabs not getting sticked below toolbar on scroll up.
below code:
<?xml version="1.0" encoding="utf-8"?>
<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:fitssystemwindows="true"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_scrollflags="scroll|exituntilcollapsed" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginend="64dp" app:expandedtitlemarginstart="48dp" app:expandedtitletextappearance="@style/transparenttext"> <framelayout android:id="@+id/carousellayout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" app:layout_collapsemode="parallax"> <imageview android:id="@+id/coverimage" android:layout_width="match_parent" android:layout_height="match_parent" android:scaletype="centercrop"/> <linearlayout android:layout_width="match_parent" android:gravity="bottom" android:orientation="vertical" android:layout_gravity="bottom" app:layout_behavior="@string/appbar_scrolling_view_behavior" android:layout_height="wrap_content"> <textview android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginleft="@dimen/profile_image_margin" android:textsize="@dimen/text_size_xlarge" android:textstyle="bold" android:padding="@dimen/profile_image_margin" android:shadowcolor="@color/text_shadow" android:shadowdx="1" android:shadowdy="1" android:shadowradius="2" android:textcolor="@color/white" android:id="@+id/content_title"/> <android.support.design.widget.tablayout android:id="@+id/slidingtabs" android:layout_width="match_parent" app:tabmode="scrollable" app:layout_collapsemode="pin" android:background="@drawable/gradient_bg" app:tabgravity="fill" app:layout_scrollflags="scroll" android:layout_height="wrap_content"/> </linearlayout> </framelayout> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" app:theme="@style/actionbarthemeoverlay" app:popuptheme="@style/actionbarpopupthemeoverlay" app:layout_collapsemode="pin" android:background="@drawable/gradient_bg" /> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <android.support.v4.view.viewpager android:id="@+id/pager" android:layout_width="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" android:layout_height="wrap_content"> </android.support.v4.view.viewpager>
please me how can achieve this. thank in advanced.
<android.support.v7.widget.toolbar android:id="@+id/anim_toolbar" android:layout_width="match_parent" android:layout_height="100dp" android:gravity="top" android:minheight="?attr/actionbarsize" app:layout_collapsemode="pin" app:titlemargintop="15dp" />
try this..it may you..
Comments
Post a Comment