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
Highlighted
Regular Contributor
Posts: 75
Registered: ‎11-30-2012
My Device: curve
My Carrier: airtel
Accepted Solution

Usage of WebView

I want to use WebView, so that I can show the webpage a native app feel. Are there any good examples on the usage of webview.?

 

I tried the below code:

 

From my Main UI, I click a button, on click of the button I call the below code, but still my view is in the main UI only.. Smiley Sad

 

WebView *view = new WebView();

view->setUrl(QUrl("http://google.com"));

 

-thanks

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Usage of WebView

Hi,

 

You'll need to add it to a page or a container just like other regular controls.

 

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

From the docs it seems it should be added to ScrollView to make it scrollable & zoomable.

 

If you want to show it fullscreen I guess you'll have to create a Sheet, put ScrollView and Container inside of a Sheet then add the WebView to the container. Then create & display the sheet.

 


Andrey Fidrya, @zmeyc on twitter