I
I
Ivan Pavlov2016-12-09 11:57:14
Android
Ivan Pavlov, 2016-12-09 11:57:14

How to hide LinearLayout when scrolling list in CoordinatorLayout?

Hello! The task is as follows: there is a standard ActionBar (I don't want to refuse it), there is a search bar below it and a list with elements at the very bottom. Is there any way to hide the search bar when scrolling through the list? All attempts to implement it myself were in vain. I tried to put a LinearLayout in the Toolbar, but it stops hiding. If you add both Toolbar and LinearLayout, then everything works, but the Toolbar is redundant in this case and visually it is not needed. Making it 0dp height doesn't work either.
Is toolbar required in AppBarLayout? Is the AppBarLayout itself required to hide items when scrolling through the list? All tutorials use AppBarLayout and they always have some kind of Toolbar. Where an arbitrary View is hidden, I did not find a tutorial.
I would be grateful for any information and guides on CoordinatorLayout!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Serkov, 2016-12-09
@iPaf

Use Behavior: www.pvsm.ru/android/113160

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question