Listview header stretched

How can I deduce a list from this list?

enter image description here Listview has a title - the singer’s avatar, when the list is expanded, the image is stretched. Pic1 is normal, pic2 is unchecked.

+4
source share
3 answers

You do not need an empty or invisible view.

Basically, you add a view (or layout) to the ListView as header using addHeaderView() . After that you cancel

  overScrollBy(int deltaX, int deltaY, int scrollX, int scrollY, int scrollRangeX, int scrollRangeY, int maxOverScrollX, int maxOverScrollY, boolean isTouchEvent) 

ListView method. You control the height of the view that you added as the title in the overScrollBy method with the overScrollBy parameter.

Check this library if you want to avoid all the hard work https://github.com/Gnod/ParallaxListView .

+3
source

This is not so difficult to achieve. You can add a transparent blank title with the image height (in expanded state). Add the layout with the image to the listView. Your layout will look like this:

 <FrameLayout> <LinearLayout> //layout with your image and controlls </LinearLayout> <ListView/> //your listView </FrameLayout> 

After that, you must implement the listView scroll changes on the listener. There you should define your transparent title on the screen and set the Y-position of the control layout. Using this technique, you can create a list-defining header behavior (parallax effect, fading animation, or something else)

0
source

You can use the parallax effect for this Gnod / ParallaxListView scal , and for this you need the ManuelPeinado solution

Acton extrusion panel or fading you can check it from here

Scale an image in the scroll list view. I think this is a solution to resolve the issue.

Hope this helps you

0
source

Source: https://habr.com/ru/post/1502012/


All Articles