by nsmnsf · 12y ago · 0 comments
Two more things:
1. The wormy scrollbar is actually standard on Android: the messaging app does it, IIRC even the twitter app on Android does it. So even though your iOS experience tells you it's weird, any users of yours on Android likely won't notice.
2. If your items are all the same height then your scrollbar won't be wormy. So if this is really that important to you, then make your ListView return items that all have the same height.
Can you expand on that? Do you mean that it's expensive for the OS for some reason, or do you mean that it's expensive for your (client) code to compute the height of each item?
It seems like in most cases it's a simple method like "return isHeader : HEADER_HEIGHT : ITEM_HEIGHT;"
To calculate the scroll accurately you need to calculate the height of 1000 elements to get the full height.
Instead in the common scenario you just calculate the height of the rows displayed on the screen and estimate the height using the average and the count.
In other scenarios (contact list, list of artists and albums and songs) you know the height of an item from its type, and you can just return (one of a set of) constants like I said. That shouldn't be expensive at all.
[1] http://stackoverflow.com/questions/15039913/android-how-to-m...