android - CollapsingToolbarLayout with tablayout & image as collapsing with sticky toolbar -
i want achieve view similar below images
below screens have achieved through design support library in android
please see layout file below
<framelayout android:layout_width="match_parent" android:layout_height="match_parent" > <android.support.design.widget.coordinatorlayout android:id="@+id/rootlayout" android:layout_width="match_parent" android:layout_height="match_parent"> <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsingtoolbarlayout" android:layout_width="match_parent" android:layout_height="match_parent" app:contentscrim="?attr/colorprimary" app:expandedtitlemarginstart="64dp" android:fitssystemwindows="true" app:layout_scrollflags="scroll|exituntilcollapsed"> <imageview android:id="@+id/backdrop" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:scaletype="centercrop" android:src="@drawable/imageburger" app:layout_collapsemode="parallax" /> <android.support.design.widget.tablayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="50dip" android:layout_below="@+id/toolbar" android:layout_gravity="bottom" android:gravity="bottom" app:layout_collapsemode="pin" app:tabgravity="center" app:tabmode="scrollable" /> </android.support.design.widget.collapsingtoolbarlayout> </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" /> </android.support.design.widget.coordinatorlayout> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" app:layout_collapsemode="pin" app:popuptheme="@style/themeoverlay.appcompat.light" app:theme="@style/themeoverlay.appcompat.dark.actionbar" /> </framelayout>
please check above xml , let me know doing wrong??
please check paul burke gists, may solve problem,
Comments
Post a Comment