简体   繁体   中英

listview scrolls quite junky when therre are different row heights

hi i've some problems with listview. My list do have very different cell heights, some of them are even bigger then the height of the screen. What I found out, that listview scrolling intepolator has problems with calculating the inertia. each time when there is big height difference between two cells currently switching in the visible area, the scrolling junks..I've looked into traceview and there actually is not that much of a delay. (there is no line tallet then the 16ms treshold, though there is visible difference), that means it actually does not junk and it is rather only quickly accelerating and deccelerating the scrolling speed. (it occurs in exactly the same time as the scrollbar height changes) Does anybody know how to solve this? I've read an article from facebook and they apparently had the same issue..There is written they needed to write their own item recycler. I'm kind of aware of that and would like to see some simpler solution.. Sorry for this question being so abstract, but I guess any code is not necessary.. thank you for your help..

ListViews recycle, the views that have been already inflated. Since in your case the Listview has items which vary in height, it is better to write your own recycler.

If you have specific categories as in X, Y and Z then you can check the layout type by adding an attribute to the layout as a tag, and inflating conditionally. But the best way to do this is write your own recycler.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM