EnterAlwaysCollapsed does not return toolbar when scrolling down

I use layout_scrollFlags="scroll|enterAlwaysCollapsed" with the minHeight from 0dip with the intention of returning only the Toolbar when my first visible element in the RecyclerView is visible (unlike, which returns it immediately when the RecyclerView scrolls). However, the toolbar no longer appears when I scroll it from the screen. What am I missing?

+4
source share
2 answers

Please see an example of a design support library application: cheesesquare

The correct way to implement the described behavior is to simply use the scroll flag yourself:

 layout_scrollFlags="scroll" 
+2
source

It's hard to say without seeing your code, as this can be one of two things:


one.

There seems to be an error with this, the view disappears from the screen when installed with a minimum height greater than zero. It then returns the minimum height when scrolling down and the full height when the scroll reaches the top.

I think your minimum height of zero may interfere with your return. As if scrollview disappears with zero minimum height, who knows what happens to cause this, a zero minimum height may make it impossible to return with this error.

Take a look at this video found here http://inthecheesefactory.com/blog/android-design-support-library-codelab/en halfway down the page.

I quote this page:

enterAlwaysCollapsed - This flag determines how View Enter returns to the screen. When your opinion is declared minHeight and you use this flag, your view will be entered only at the minimum height (ie, “collapsed”), only re-expanding to full height when the scroll has reached the top. Use it with the scroll icon as follows: scroll | enterAlwaysCollapsed

In any case, it seems that it does not work, as described in the minHeight part.

I added an accent.


2.

You did not format your code correctly.

From the Android Developers Blog I quote "CoordinatorLayout and the application bar":

One note: all views using the scroll flag must be declared earlier that do not use the flag. This ensures that all views are from above, leaving fixed elements behind.

This link also details how to use enterAlwaysCollapsed and is worth a look.

Let me know if this solves your problem.

0
source

All Articles