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

Native Development

Reply
New Contributor
Posts: 8
Registered: ‎02-26-2013
My Device: Blackberry Z10 STL100-3
My Carrier: Rogers

ScrollView's scrollToPoint() is ignored when user is dragging?

I just ran into a interesting issue: I have a scroll view and a button in container. When button is clicked, I call scrollToPoint(0, 0, ScrollAnimation::None) of the scroll view. It works fine until I tried to scrolling and click the button at same time (I drag/scroll the scroll with one finger and click the button with another). The "scrollToPoint" is called but it makes no effect. 

 

Could anyone explain this behavior? What I'm trying to do here is to adjust scroll view's viewable area while user is scrolling. I goal is to call "scrollToPoint" inside "onViewableAreaChanging" slot.

 

Thanks

New Contributor
Posts: 8
Registered: ‎02-26-2013
My Device: Blackberry Z10 STL100-3
My Carrier: Rogers

Re: ScrollView's scrollToPoint() is ignored when user is dragging?

update: After more testing, I found that none of the following methods would take effect if the scroll view is tracking user's touch:

 

void scrollToPoint (float x, float y, bb::cascades:Smiley FrustratedcrollAnimation::Type scrollAnimation=bb::cascades:Smiley FrustratedcrollAnimation:Smiley Very Happyefault)

void resetViewableArea(bb::cascades:Smiley FrustratedcrollAnimation::Type scrollAnimation=bb::cascades:Smiley FrustratedcrollAnimation:Smiley Very Happyefault)

void zoomToPoint (float x, float y, float contentScale, bb::cascades:Smiley FrustratedcrollAnimation::Type scrollAnimation=bb::cascades:Smiley FrustratedcrollAnimation:Smiley Very Happyefault)

void zoomToRect (const QRectF &rect, bb::cascades:Smiley FrustratedcrollAnimation::Type scrollAnimation=bb::cascades:Smiley FrustratedcrollAnimation:Smiley Very Happyefault)

 

The problem is my application has no way to tell if my invokation to these methods will take effect, unless I also track user touch event manually. 

 

Is this some known behavior of ScrollView or someone could provide with some explanation?

 

Thanks