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 to pin a view to the top in SmoothAppBarLayout #187

Closed Chen-Sir closed 7 years ago

Chen-Sir commented 7 years ago

`<android.support.design.widget.CoordinatorLayout android:layout_width="match_parent" android:layout_height="match_parent">

<android.support.v7.widget.RecyclerView android:id="@android:id/list" 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="@dimen/app_bar_height">

  <android.support.v7.widget.Toolbar
    android:id="@+id/toolbar"
    app:layout_scrollFlags="scroll"
    app:navigationIcon="@drawable/ic_menu_arrow_back"
    style="@style/AppStyle.MdToolbar" />

  <TextView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
   />

</me.henrytao.smoothappbarlayout.SmoothAppBarLayout> </android.support.design.widget.CoordinatorLayout>`

look at the code, I want the TextView to pin to the top of screen , just like the original AppBarLayout, but by your SmoothAppBarLayout , the textview also scrolls and is going to be invisible.

How to fix this problem? tks

taatu0 commented 7 years ago

app:layout_scrollFlags="scroll" Change scroll flag to pin

Chen-Sir commented 7 years ago

@taatu0 “pin” flag is in CollapsingToolbarLayout.