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
Contributor
Posts: 13
Registered: ‎06-18-2010
My Device: Z10
My Carrier: MTN

Why does Webview cut of displayed html?

So I have an html being displayed, but it gets cut off on the right side. Padding and margins don't seem to work.

Contributor
Posts: 13
Registered: ‎06-18-2010
My Device: Z10
My Carrier: MTN

Re: Why does Webview cut of displayed html?


ScrollView {
     WebView {
          id: webViewTC
          url: "local:///assets/data/en/tc.html"
          settings.background: Color.Transparent
          verticalAlignment: VerticalAlignment.Center
          horizontalAlignment: HorizontalAlignment.Center
          settings.defaultFontSizeFollowsSystemFontSize: true
          settings.minimumFontSize: 28
     }
}

 

Even with the minimumFontSize or without it there seems to be NO wrapping from the right side, text just gets cut off.

Retired
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: Why does Webview cut of displayed html?

[ Edited ]

Hi blouapp, i have tried your code with a long .html file and it seems to work fine on the 10.1 SDK. There is no right truncation. Please ensure you are using the most recent version of the SDK and OS. If you are, could you please post a screenshot and the .html file you are using?

 

 

IMG_00000003.png

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: Why does Webview cut of displayed html?

I'm getting annoying cutting-off behavior as well:

 

ScrollView {
WebView {
url: "https://www.facebook.com/dialog/oauth?client_id=184540545057479&redirect_uri=http://www.danielbigham...
topMargin: 0
topPadding: 0
}
}

 

There is a set of whtie margins around the webview... how does one remove them? It would seem that if they weren't there, the content probably wouldn't be cutt off.

Developer
Posts: 587
Registered: ‎04-01-2009
My Device: Z10, PlayBook
My Carrier: NA

Re: Why does Webview cut of displayed html?

Wow, I'm a butt-head Smiley Happy  I had padding on my Sheet.  Please ignore. Maybe the original poster had something similar.

Developer
Posts: 541
Registered: ‎05-17-2009
My Device: Not Specified

Re: Why does Webview cut of displayed html?

If your web page is using CSS, I think the problem is likely because a bug in WebView does not properly set the viewport settings. 

 

Try adding the settings.viewport line from this API doc:

 

http://developer.blackberry.com/cascades/reference/bb__cascades__websettings.html#property-viewport

Developer
Posts: 366
Registered: ‎07-15-2013
My Device: blackberry Z10
My Carrier: Personal

Re: Why does Webview cut of displayed html?

Maybe you should call de desciption with ["content:encoded"].

 

Or maybe you should enlarge the margins

If you find this information useful please click like --->
@mezeitune on twitter
Developer
Posts: 64
Registered: ‎09-10-2009
My Device: Z10, Bold 9700
My Carrier: O2 Germany

Re: Why does Webview cut of displayed html?

I just noticed the same problem when using a WebView inside of a container with leftPadding: 25.0 and rightPadding: 25.0. Text on the right side gets cut off. Could anyone get this working? I didn't find a viewport configuration that solved the problem for me. Removed the padding for now.
----

My Twitter: @hendrik_dev
Developer
Posts: 1,746
Registered: ‎04-08-2010
My Device: Passport Silver, PRIV
My Carrier: Telekom.de, O2, Vodafone

Re: Why does Webview cut of displayed html?

yesterday also run into this

had to remove all padding from Container

 

to align the Webview field with other fields on Page,

I did this as workaround:

set property at Webview field:

 

scaleX: 0.9

 

now the content of Webview is aligned with other fields.

 

-------------------------------------------------------------------------------
ekke (independent software architect, rosenheim, germany)

BlackBerry Elite Developer
BlackBerry Platinum Enterprise Partner
International Development native Mobile Business Apps
BlackBerry 10 | Qt Mobile (Android, iOS)
Workshops / Trainings / Bootcamps

blog: http://ekkes-corner.org
mobile-development: http://appbus.org Twitter: @ekkescorner
Developer
Posts: 64
Registered: ‎09-10-2009
My Device: Z10, Bold 9700
My Carrier: O2 Germany

Re: Why does Webview cut of displayed html?

Thanks, ekke, that's a great idea!

Note: I also had to add scaleY in order to prevent distortions.
----

My Twitter: @hendrik_dev