scrolling in listview with different cell height

落爺英雄遲暮 提交于 2019-12-04 18:14:48

问题


I have a listview and its rows have different heights.

When I scroll up, rows appear to move up or down erratically.
(I don't find the behavior when I scroll down)

I suspect its due to the fact

  1. listView picks one of used rows
  2. the row is placed on top of visible rows.
  3. listView changes the row's height(here erratic movement)

but it's a guess.

I tried googling since this should be a common problem but couldn't find any.


回答1:


In this case, setting the right item height did the trick :

How to set different heights for each row in a ListView?

Edit: oh, and make sure you recycle the items correctly :

ListView reusing views when ... I don't want it to



来源:https://stackoverflow.com/questions/14036810/scrolling-in-listview-with-different-cell-height

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!