henrytao-me / smooth-app-bar-layout

Smooth version of Google Support Design AppBarLayout
Apache License 2.0
1.77k stars 240 forks source link

how can i make both toolbar and tabLayout stay top,not scroll out of the screen #196

Closed Mao-x-w closed 7 years ago

Mao-x-w commented 7 years ago

@henrytao-me how can i make both toolbar and tabLayout stay top,not scroll out of the screen

henrytao-me commented 7 years ago

Can you post your layout here?

XuanLiuNB commented 7 years ago
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:layout_width="match_parent"
  android:layout_height="match_parent">

  <android.support.v4.view.ViewPager
    android:id="@+id/view_pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

  <me.henrytao.smoothappbarlayout.SmoothAppBarLayout
    android:id="@+id/smooth_app_bar_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="@dimen/mdSecondaryActionBarSize">

    <android.support.design.widget.CollapsingToolbarLayout
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      app:layout_scrollFlags="scroll|exitUntilCollapsed">

      <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:background="@android:color/transparent"
        app:layout_collapseMode="pin"
        app:navigationIcon="@drawable/ic_menu_arrow_back"
        style="@style/AppStyle.MdToolbar" />
    </android.support.design.widget.CollapsingToolbarLayout>

    <android.support.design.widget.TabLayout
      android:id="@+id/tab_layout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content" />
  </me.henrytao.smoothappbarlayout.SmoothAppBarLayout>
</android.support.design.widget.CoordinatorLayout>

hello, i have the same issue, in this layout ,why Toolbar cannot stay on the top ,it alway being slipped out. only TabLayout can stay.

henrytao-me commented 7 years ago

Hi @XuanLiuNB,

As you can see on README, this library is deprecated from Support Library 26.0.0 and later. Please use original Support Library. Thanks.

XuanLiuNB commented 7 years ago

thank you!