I am trying to load a local HTML page in a webview with Xamarin forms. I am using the basic example in the dev docs although I can get a URL to load I can\'t get my own HTML
WebView.BaseUrl
only tells the WebView
where to start looking for files. It's the root folder of the "web site". By default browsers will load the file index.html
, so if you rename your file to index.html
I believe it should load automatically.
I think this should be possible too:
webviewjava.BaseUrl = DependencyService.Get().Get();
webviewjava.Source = "TestWebPage.html";
Here you're saying "use this location as the default place to look for files" and "look up this file and use it as the source for the HTML".