i using coordinator layout custom collapsing view , tablayout. here xml
<android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:fresco="http://schemas.android.com/apk/res-auto" android:id="@+id/main_content" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.light"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/collapsing_toolbar" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" app:contentscrim="?attr/colorprimary" app:layout_scrollflags="scroll|exituntilcollapsed"> <relativelayout android:id="@+id/cardparentlayout" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_collapsemode="parallax"> <com.facebook.drawee.view.simpledraweeview android:id="@+id/profilepicoverlay" android:layout_width="match_parent" android:layout_height="match_parent" fresco:actualimagescaletype="centercrop" fresco:overlayimage="@drawable/profile_overlay" /> <relativelayout android:id="@+id/childparenttoanimate" android:layout_width="match_parent" android:layout_height="match_parent" android:visibility="invisible"> <include android:id="@+id/cardlayout" layout="@layout/layout_profile_card" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" /> <com.facebook.drawee.view.simpledraweeview android:id="@+id/profilepiccard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" fresco:actualimagescaletype="centercrop" fresco:backgroundimage="@drawable/profile_placeholder" fresco:roundascircle="true" fresco:roundingbordercolor="@color/white" fresco:roundingborderwidth="2dp" /> </relativelayout> </relativelayout> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="51dp" app:layout_collapsemode="pin" app:popuptheme="@style/apptheme" /> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="fill_vertical" android:fillviewport="true" android:orientation="vertical" app:layout_behavior="@string/appbar_scrolling_view_behavior"> <android.support.design.widget.tablayout android:id="@+id/tabs" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:layout_gravity="bottom" android:background="@color/blue_primary" app:tabgravity="fill" app:tabindicatorcolor="@android:color/white" app:tabmode="fixed" /> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="match_parent" android:layout_height="match_parent" /> </linearlayout> </android.support.design.widget.coordinatorlayout>
the problem when collapsed, toolbar appearing white (default gray color) can see in image.
if add background attribute toolbar in xml, toolbar appearing when not collapsed
Comments
Post a Comment