WebView questions

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
I am using a WebView to display third-party webpages. I have tried loading the webpage two different ways. First with LoadURL, then with HTTPUtils2 and LoadHTML of the returned string from the GET.

On certain webpages if I use LoadURL trying to set the zoom and scroll positions does not work properly. If I pinch-zoom, the page quickly bounces back to the original Zoom.

When I use the LoadHTML method setting initial zoom and then the scroll position after the page loads works, most of the time.

The WebView PageFinished event fires before the page is actually finished rendering – sometimes the scroll setting is not accepted. I have PageFinished enable a timer where getProgress is queried. GetProgress always returns 100% – even when the page is not 100% loaded and rendered. There is a fix for this problem that can be found on the web, but I would not know how to implement this in B4A.

Another problem with the LoadHTML method is that webpages using local content references (such as: "src=pic.png" rather than "src=http://some.com/pic.png") do not load the content properly. It assumes the content is local. Android has a loadDataWithBaseURL method to address this problem. Unfortunately, I don't see it available in the B4A implementation.

So… My question:
Has anybody else encountered these problems? Have you found a solution?

Any help is greatly appreciated.

Thanks,
Barry.
 
Top