Listview items Animation Stop While Scrolling

后端 未结 3 1965
旧时难觅i
旧时难觅i 2021-02-13 03:26

I am trying to show ProgressBar with a simple animation for each ListView item, but when I am scrolling, the ProgressBar animation stops.

3条回答
  •  失恋的感觉
    2021-02-13 04:14

    It is stopping because getview is called again and again when list items are visible thus resetting the view to avoid any frame skips/lag on the devices..

    what you need to do is to create a view holder with boolean and set it as a tag to the view.. each time is it animating boolean should be true and false when it stops.. so when getview is called your progressbar animation is still starting or stopping depending on the boolean..

提交回复
热议问题