android - How to remove transparent Toolbar padding when collapsed in CollapsingToolbarLayout -
i use collapsingtoolbarlayout in app when collapsed, there marginleft , marginright in toolbar picture below.
when set toolbar background not transparent ,such red,it normal.
how should remove margin?
i want below background transparent
xml code
<android.support.design.widget.appbarlayout android:id="@+id/appbarlayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/transparent"> <android.support.design.widget.collapsingtoolbarlayout android:id="@+id/toolbarlayout" android:layout_width="match_parent" android:layout_height="wrap_content" app:collapsedtitlegravity="center_horizontal" app:layout_scrollflags="scroll|exituntilcollapsed" app:popuptheme="@style/themeoverlay.appcompat.light" app:expandedtitlegravity="center_horizontal" app:statusbarscrim="@color/transparent" app:contentscrim="@color/transparent" app:expandedtitletextappearance="@style/collapsingtoolbarlayoutexpandedtext" app:collapsedtitletextappearance="@style/collapsingtoolbarlayoutcollapsedtext" app:expandedtitlemargintop="0dp" app:expandedtitlemarginbottom="20dp"> <view android:id="@+id/venueimage" android:layout_width="match_parent" android:layout_height="100dp" app:layout_collapsemode="parallax" app:layout_collapseparallaxmultiplier="0.7"/> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="@color/transparent" android:layout_margintop="@dimen/status_bar_height" app:layout_collapsemode="pin" app:contentinsetleft="0dp" app:contentinsetright="0dp"/> </android.support.design.widget.collapsingtoolbarlayout> </android.support.design.widget.appbarlayout>
adding app:elevation="0dp"
appbarlayout
widget fixed me.
also in layout have appbarlayout
nested inside coordinatorlayout
whereas your's reverse.
Comments
Post a Comment