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
Developer
Developer
Posts: 132
Registered: ‎01-24-2013
My Device: blackberry z10
My Carrier: none

Using ScrollView (basic)

Hello.

 

I tried the code below to get  a webview that can scroll its contents if its too big to show on screen at once.

Unfortunately it doesnt allow the user to scroll. It shows as if I hadnt used a scrollview at all.

Am I doing something silly? Is this not the way one is supposed to use a ScrollView?

 

Thanks very much in Advance.

 

//------------------------------------------------------------------

    WebView* Wv = new WebView();
       Wv->setUrl(QUrl("http://208.74.204.192/t5/Cascades-Development/webView-keeps-crashing-on-sim/td-p/1872379"));


        ScrollView * Sv = new ScrollView();
        Sv->setContent(Wv);
        Sv->scrollViewProperties()->setScrollMode(ScrollMode::Vertical);

        Wv->setVisible(true);

        Page *Pg = new Page();
        Pg->setContent(Sv);
        Application::instance()->setScene(Pg);

Developer
Posts: 88
Registered: ‎01-05-2013
My Device: BB10
My Carrier: Viettel

Re: Using ScrollView (basic)

You can try this

 scrollViewProperties {
       scrollMode: ScrollMode.Both
    }

 https://developer.blackberry.com/cascades/reference/bb__cascades__scrollview.html

Developer
Posts: 124
Registered: ‎01-29-2011
My Device: Z10, PlayBook
My Carrier: Koodo

Re: Using ScrollView (basic)

I've played around a bit with an ImageView wrapped in ScrollView and I believe my code looks fundamentally similar. The main difference is that my ScrollView is in a Container. Not sure what (if any) difference that might make.