1

Screen after collapsed

Using CollapsedToolbarLayout: when picture is hiden and collapsed, the title is going to the top(in toolbar), but not on the same level(line) with the back(and menu) icons. Where can there be a mistake? (Everything is put inside CoordinatorLayout with width and height = match_parent and fitsSystemWindows="true")

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:fitsSystemWindows="true"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
    >

  <android.support.design.widget.CollapsingToolbarLayout
      android:id="@+id/collapsing"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:fitsSystemWindows="true"
      app:contentScrim="?attr/colorPrimary"
      app:layout_scrollFlags="scroll|exitUntilCollapsed"
      app:title="Hello"
      app:collapsedTitleGravity="center_vertical"
      >

    <android.support.v7.widget.AppCompatImageView
        android:id="@+id/backdrop"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        android:scaleType="centerCrop"
        android:background="@color/greenMain"
        app:layout_collapseMode="parallax"
        />

    <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"
        menu="@{R.menu.menu_profile}"
        navigationIcon="@{R.drawable.ic_small_arrow_left}"
        />
  </android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.