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

Java Development

Reply
New Contributor
Posts: 6
Registered: ‎10-17-2011
My Device: 9700
My Carrier: Vodophone

Zoom in with both scrolls enabled

Hi,

 

I'm creating an Blackberry App which would open a broswerfield loadind an HTML page. By default, when I try to browse a page in a Blackberry Browser and try to zoom in, I get both vertical and horizontal scroll bars.

 

How can I achieve this in my Application?.

 

Please help me with a sample code/ tutorial link.

Contributor
Posts: 22
Registered: ‎11-09-2011
My Device: 9780Bold
My Carrier: DOCOMO

Re: Zoom in with both scrolls enabled

try this you can scroll in your browser field

 

VerticalFieldManager main_mgr=new VerticalFieldManager(VERTICAL_SCROLL|VERTICAL_SCROLLBAR|HORIZONTAL_SCROLL|HORIZONTAL_SCROLLBAR){
            protected void sublayout(int maxWidth, int maxHeight) {
                
                super.sublayout(Display.getWidth(),Display.getHeight());
                setExtent(Display.getWidth(),Display.getHeight());
            }
        };
//        url="local:///index4.html";http://docs.blackberry.com/en/
        
        url="http://www.blackberry.com";
        BrowserFieldConfig browserFieldConfig = new BrowserFieldConfig();
        browserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER);
        browserFieldConfig.setProperty(BrowserFieldConfig.JAVASCRIPT_ENABLED,Boolean.TRUE);
        browserFieldConfig.setProperty(BrowserFieldConfig.ALLOW_CS_XHR,Boolean.TRUE);
        browserField=new BrowserField(browserFieldConfig);
        
         browserField.requestContent(url);
         main_mgr.add(browserField);
         add(main_mgr);

New Contributor
Posts: 6
Registered: ‎10-17-2011
My Device: 9700
My Carrier: Vodophone

Re: Zoom in with both scrolls enabled

The above code sample is not working.

Highlighted
Contributor
Posts: 22
Registered: ‎11-09-2011
My Device: 9780Bold
My Carrier: DOCOMO

Re: Zoom in with both scrolls enabled