Creating animation for images from small to large when scrolling vertical

后端 未结 2 1388
無奈伤痛
無奈伤痛 2020-12-04 22:47

I am creating images in which when scrolled up, the image should get enlarged and remaining images should get smaller. Similarly when second image pushed up, it should enlar

2条回答
  •  一个人的身影
    2020-12-04 23:29

    I think if the container you are using is a ListView, then following must be useful.Just need to detect the center element of the list view, and apply the zooming effect to the image in that row.Following is the code that can be used to implement this strategy:

    int visibleChildCount = (listView1.getLastVisiblePosition() - listView1.getFirstVisiblePosition()) + 1;

    In your getView() method:
    if(position==visibleChildCount/2)
    {
     //Center Element
     //Apply the Transition Effect From the XML files to the Image to Grow.
    }
    

提交回复
热议问题