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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device
My Carrier: Developper

Scrollview scrolling down itself

Hi all,

 

I have a strange behavior in my app.

I have a page with a Scrollview, in this scrollview there a Label, Webview, horizontal Listview.

When I make the page and assign value for each component sometimes the scrollView automatically scroll down...

It seems to be when there is a huge content in my webview (if there isn't a webview there isn't problem).

The content can change with a user action and then the scrollView scroll down too.

 

The strangest is that if I put the app in background and immediatly get it in frontground, the strange behavior doesn't occur anymore.

 

Anyone not this before ? Maybe something append when the app is backgrounded and foregrounded that fix this behavior.

 

I don't understand.

 

Thanks.

 

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
Contributor
Posts: 10
Registered: ‎10-25-2011
My Device: bold
My Carrier: fido

Re: Scrollview scrolling down itself

Have you placed your webview directly within the scrollview, or is it placed within it's own container inside the scrollview. I noticed if the webview is placed within a seperate container inside the scrollview, it automatically scrolls to where the webview starts. However, if you place the webview directly in the scrollview without it being inside a seperate container, it seems to work properly. 

Developer
Posts: 75
Registered: ‎09-12-2012
My Device: Looking for a BB10 testing device
My Carrier: Developper

Re: Scrollview scrolling down itself

Thanks for your interest.

No the webview is in a container, with label and other elements.

---------
Mobile developer freelance - QtQuick - Cascades - WP7 - Android
My works : http://fdelgado.fr
Contributor
Posts: 10
Registered: ‎10-25-2011
My Device: bold
My Carrier: fido

Re: Scrollview scrolling down itself

So I'm guessing you have it placed like this?

    ScrollView

    {

        Container

        {

            Label

            {

             }

            Label

            {

             }

            Webview

            {

             }

       }

}

 

Developer
Posts: 410
Registered: ‎06-03-2010
My Device: Z10 Red
My Carrier: Free

Re: Scrollview scrolling down itself

I have the same structure that you guessed and the same problem. Does anyone has found a workaround ?

Developer
Posts: 64
Registered: ‎09-10-2009
My Device: Z10, Bold 9700
My Carrier: O2 Germany

Re: Scrollview scrolling down itself

I just noticed the same problem with my WebView. If anyone knows of any solution, I'd be glad to know.
----

My Twitter: @hendrik_dev
Contributor
Posts: 14
Registered: ‎06-01-2011
My Device: BlackBerry Q10
My Carrier: Three UK

Re: Scrollview scrolling down itself

[ Edited ]

Figured out a workaround... not sure if it will always work or why, but it works for me; 

 

I had a webview loading local HTML so I made it visible:false, and intercepted onNavigationRequested. In this, I then made it visible. So basically, it becomes visible after its already loaded and is loading new content. as onNavigationRequested is called even for the initial content load

 

Hopefully might help someone, or lead to a better solution. 

 

                        onNavigationRequested: {
                           
                            var thisUrl = request.url.toString(); 

                            if(thisUrl.indexOf("http") > -1) {
                                request.action = WebNavigationRequestAction.Ignore
                            }
                            else {
                                myWebView.visible = true; 
                            }
                        }