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:
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 the viewport
of the parent List
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 your DataChange
handler. If it traces out after initialization, you know virtualization is workingTileLayout
itself is likely not the issue you are having, it is the ItemRenderer
.
ItemRenderer
class except LabelItemRenderer
and IconItemRenderer
. DisplayObject
. Instead, override createChildren()
and do it there. Override layoutContents()
for positioning and sizing. Override drawBackground()
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 a Rect
or similar. ContentCache
for any images outside of the iconDisplay
in IconItemRenderer
. ContentCache will negate the need for reloading images every single time.(iconDisplay
/icon
already utilizes this by default)