A Andie Member Licensed User Longtime User Jul 6, 2015 #1 Hi, with the help of the WebViewExtras library one is able to scroll down a website, which is displayed in a WebView: (WebViewExtras1 and WebView1 are instances of WebViewExtras und WebView respectively) Code: WebViewExtras1.pageDown(WebView1, true) This works fine, assuming that the LoadUrl()-method was applied on the WebView. But one can also apply the LoadHtml()-method. For example: Code: WebView1.LoadHtml("<html><body>text ... and much, much more ... text</body></html>") But using the pageDown()-method then, doesn't show any effect. Has anyone an explanation for it? May be some tag is missing in the html-Text?
Hi, with the help of the WebViewExtras library one is able to scroll down a website, which is displayed in a WebView: (WebViewExtras1 and WebView1 are instances of WebViewExtras und WebView respectively) Code: WebViewExtras1.pageDown(WebView1, true) This works fine, assuming that the LoadUrl()-method was applied on the WebView. But one can also apply the LoadHtml()-method. For example: Code: WebView1.LoadHtml("<html><body>text ... and much, much more ... text</body></html>") But using the pageDown()-method then, doesn't show any effect. Has anyone an explanation for it? May be some tag is missing in the html-Text?
eurojam Well-Known Member Licensed User Longtime User Jul 6, 2015 #2 I guess, that webview1.loadHtml is an asynchronous task and pageDown will be executed before the page finished loading. one solution is may be to run the pagedown delayed. But I haven't tried this... Upvote 0
I guess, that webview1.loadHtml is an asynchronous task and pageDown will be executed before the page finished loading. one solution is may be to run the pagedown delayed. But I haven't tried this...
A Andie Member Licensed User Longtime User Jul 6, 2015 #3 You are absolutely right and I took care of it by using: Code: WebView1_PageFinished (Url As String) WebViewExtras1.pageDown(WebView1, true) End Sub However, as you see, I left the argument of this PageFinished-event i. e. (Url as String) unchanged, because I don't know what argument I could use instead. Upvote 0
You are absolutely right and I took care of it by using: Code: WebView1_PageFinished (Url As String) WebViewExtras1.pageDown(WebView1, true) End Sub However, as you see, I left the argument of this PageFinished-event i. e. (Url as String) unchanged, because I don't know what argument I could use instead.
eurojam Well-Known Member Licensed User Longtime User Jul 6, 2015 #4 you can try to call it anyway with a delay of let's say 100 ms. it is a workaround... Code: WebView1_PageFinished (Url As String) delay(100) WebViewExtras1.pageDown(WebView1, true) End Sub where a delay function is described here: https://www.b4x.com/android/forum/threads/a-delay-time-of-function.13177/ Upvote 0
you can try to call it anyway with a delay of let's say 100 ms. it is a workaround... Code: WebView1_PageFinished (Url As String) delay(100) WebViewExtras1.pageDown(WebView1, true) End Sub where a delay function is described here: https://www.b4x.com/android/forum/threads/a-delay-time-of-function.13177/
A Andie Member Licensed User Longtime User Jul 6, 2015 #5 If think there's no need to work with a delay, because the PageFinished-event works perfectly. I'm still wondering why in the case of: Code: WebView1.LoadUrl("https://www.b4x.com") the pageDown-method works fine, while in the case of: Code: WebView1.LoadUrl("file://" & File.DirInternal & "/test.htm") it does not. Last edited: Jul 6, 2015 Upvote 0
If think there's no need to work with a delay, because the PageFinished-event works perfectly. I'm still wondering why in the case of: Code: WebView1.LoadUrl("https://www.b4x.com") the pageDown-method works fine, while in the case of: Code: WebView1.LoadUrl("file://" & File.DirInternal & "/test.htm") it does not.