I have a list view with difference item layouts.
First I inflated the view and store it memory.
When the list view get the child view (from g
开发者_运维知识库etChildView function)) I will return the in-memory object. Everything seems ok except when I scroll the list, the view is shrink to 2/3 original size and after that it become bigger (fullsize).
I hope that is an animation of android OS but still not found the solution now.
The reason why I need to load it from memory is the inflate function take a lot of time (~100 miliseconds on HTC desire) and make the scrolling does not smooth (lag)
Have you meet this?
I tested on android version: 2.0 and 2.2
you didn't mentioned it in your question, but do you use convertView
parameter in the getView()
method of the list adapter? You shouldn't inflate view on every getView()
call, because ListView
class has a special view recycle bin for storing inflated views. You can get some explanations from this video.
继续阅读:android
精彩评论