Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
studiochris
Posts: 165
Registered: ‎10-26-2010
My Device: BlackBerry® PlayBook™

Re: QNX List scroll

Instead of having to use the random timer, you may want to try Tweener's delay property to make it wait 0.01 seconds before executing the animation. Should make for shorter, less complicated code.
Contributor
friedit
Posts: 32
Registered: ‎12-08-2010
My Device: Not Specified

Re: QNX List scroll

[ Edited ]

just call listname.drawNow() before scrolltoindex.

 

its the same like in flex where you have to call validateNow()

Developer
Acenet
Posts: 249
Registered: ‎11-02-2010
My Device: PlayBook

Re: QNX List scroll

Ah yes, calling drawNow() before indexToScroll() works fine too indeed ! I used it at the end, that was my error... hehe

JC
Contributor
imrahil
Posts: 12
Registered: ‎01-16-2011
My Device: Z10 Limited Edition

Re: QNX List scroll

This is solution for SectionList:

var firstItem:ICellRenderer = sectionListComp.firstVisibleItem; 
var isHeader:Boolean = firstItem.isHeader;
var visibleSectionIndex:int = firstItem.section;
var visibleItemIndex:int = firstItem.index;
                
sectionListComp.dataProvider = roster;
sectionListComp.drawNow();
                
if (isHeader)
{
        sectionListComp.scrollToIndex(visibleSectionIndex, 0);
}
else
{
        sectionListComp.scrollToIndexInSection(visibleSectionIndex, visibleItemIndex, 0);
}
New Contributor
pauluz
Posts: 5
Registered: ‎07-07-2012
My Device: Playbook

Re: QNX List scroll

Probably it's the best soluction I know.

Pawel "pauluZ" Szczepanek
BlackBerry Developer
Android Evangelist