iOS Question WebView.Top Problem

cbanks

Active Member
Licensed User
Longtime User
Why doesn't this code take me to the top of the webview? My webview is called WebView1.

B4X:
WebView1.Top = 0
 

DonManfred

Expert
Licensed User
Longtime User
Why doesn't this code take me to the top of the webview? My webview is called WebView1.
Because Webview1.Top SETs the Top-Position of your Webview inside your Activity. It does not navigate the webpage showed inside your Webview.

See webview1.Left, .Width and .Height too but YOU already should know that (beeing part of community since three years). That´s basic knowledge about views ;-)

I think you should use WebViewExtras and this command from it

pageUp(webView1 As WebView, scrollToTop As boolean)
Scroll the contents of webView1 up by half the page size.
scrollToTop - If true then webView1 will be scrolled to the top of the page.
Returns a Boolean value to indicate the success or failure of the scroll.

Edit: Sorry... i misintepreted here! Did not realized that i´m reading B4I-Forum right now :-/

BUT:
webview1.left/top/width/height are the same like in B4A i believe.
 
Last edited:
Upvote 0
Top