开发者

Android - View be shrink when load from memory

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

Android - View be shrink when load from memory


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜