Scroll down the list to ListView, for example a phone app with lollipop

I have a layout with linearLayout (top layout) and a listview below that. What I want to do is like a phone app in Lollipop:

  • With the scroll bar I can scroll through the contacts list (top layout does not move)

  • Scrolling the list with your finger first scrolls the top layout, and after it no longer appears in the list, the list scrolls. When the top view is displayed, the scroll bar does not move.

Does anyone know how to do this?

What I think:

  • I can add the top layout to the listview header, but the scrollbar takes up the header count. And if I scroll the scrollbar, the top layout will scroll

    • Trying to set scrollListener to listview and translate top view, but don't think it will be good and scrollY is not available for listView

I think I can do something with the scrollView for the root layout, but I know it is not good to put the listview inside the scroll.

I have not found a suitable way to make this function ...

EDIT: To be more clear, I want to translate the list before I can scroll through the list. The problem is the translation of the list, the height of the list will not expand.

+3


source to share


1 answer


I also get this issue in 5.1 in a lower version, it works great. Try to use in 5.0. Like STABLE verson, also check another 5.1 scroll in this link here I couldn't comment, so I'm posting this as an answer.



+2


source







All Articles