I am targeting mobile using FlashBuilder, I am using TileLayout
to view items of data, I am setting useVirtualLayout
to "true"
I have some questions please:
- Is item renderer resued by default? or shall I set it to true my self?
- How can I control the range of items being virtualized?
- Is there any tips on boosting performance of building child items of
TileLayout
?
If native TileLayout
is slow, is there alternative control to use? if building my own would be better, is there any example to build custom layout?
ItemRenderer
leaves theviewport
of the parentList
control. So if you have a list on a page and that page is controlling the scrolling and not the list, I don't believe virutalization occurs. That is what I have seen in the past. Not sure if that is how it actually works, but that is the impression I have gotten. Easy way to find out is to throw a trace statement in yourDataChange
handler. If it traces out after initialization, you know virtualization is workingTileLayout
itself is likely not the issue you are having, it is theItemRenderer
.ItemRenderer
class exceptLabelItemRenderer
andIconItemRenderer
.DisplayObject
. Instead, overridecreateChildren()
and do it there. OverridelayoutContents()
for positioning and sizing. OverridedrawBackground()
for handling the background. I highly suggest reading this post from Flextras (you'll see him going by Reboog77 on SO) about writing mobile item renderers. https://www.flextras.com/blog/index.cfm/2011/6/24/Building-a-Mobile-ItemRenderer-in-FlexGraphics
class, do that instead of using aRect
or similar.ContentCache
for any images outside of theiconDisplay
inIconItemRenderer
. ContentCache will negate the need for reloading images every single time.(iconDisplay
/icon
already utilizes this by default)