AnujAroshA
AnujAroshA

Reputation: 4811

How to code for horizontal scrolling for BrowserField in BB

I am new to BB development. I want to load a WebView inside my BB application without using the default device browser to load the URL. Following is the code I have used inside my BrowserScreen class which extends MainScreen.

    BrowserField browserField = new BrowserField(myBrowserFieldConfig);
    browserField.addListener(myBrowserFieldListener);
    add(browserField);
    browserField.requestContent("http://www.myurl.com/");

This will load the URL and display the web page without any error. Only issue is that web site is not developed specifically mobile devices. So the width of the web site is beyond the BB device screen. I can only scroll vertically not horizontally. How can I programmatically enable horizontal scrolling in BrowserField.

Thanks a lot.

Upvotes: 0

Views: 343

Answers (1)

Ak47
Ak47

Reputation: 11

This code should work:

public class YourClass extends MainScreen {   
    public YourClass()   {
        //Apply config here if you want
        BrowserField myBrowserField=new BrowserField();
        HorizontalFieldManager manager=new HorizontalFieldManager(Manager.HORIZONTAL_SCROLL|Manager.VERTICAL_SCROLL);
        manager.add(myBrowserField);
        this.add(manager);   
    } 
} 

Upvotes: 1

Related Questions