Adobe Air for mobile: Why is addElement (to a view) so slow? How can I optimize this?
I am building an application for a mobile phone, using Flash Builder 4.5 and Adobe air. I use a flex mobile project. However, at certain times I need to add 10, 20 dynamic elements to a scroll list for example, these elements cannot be created in flex beforehand, seeing as I get them from a server (images and the like).
However, when I add them using addElement (to a view) it takes quite a long time. I tested it on the iPhone 3GS, and it takes about 150 to 200 miliseconds per element. T开发者_开发技巧his is with the most recent version of air, and packaged the best way possible. I have also experimented with cpu and gpu rendermodes, which did not seem to affect things at all.
Is there a way to speed this up? Alternatively (or even better, additionally), is there a way to cache views, so they do not need to be recreated every time I open a view? I use the ViewNavigator to navigate to views.
精彩评论