I am completely lost as to why this HTML is not working within a WebView on Android within Xamarin. It's been a hair pulling experience trying to get something this simple working.
The HTML source is as below. I would expect the screen to go blue, but it stays orange:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>MyTitle</title>
<style>
body {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
background: orange;
}
.fullScreenDiv {
position: absolute;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: blue;
}
</style>
</head>
<body>
<div id='myId' class='fullScreenDiv'> </div>
</body>
</html>
A few things I have looked into:
It shows absolutely fine in Chrome.
I am using Kitkat, with hardware acceleration turned off.
"http://www.google.com/" loads fine in the WebView.
I have attached a remote debugger (https://developer.chrome.com/devtools/docs/remote-debugging#debugging-webviews) and it looks like the calculated height of the body is 0px, which I assume is why it is not showing.

Below is the code containing the WebView init.
if (Build.VERSION.SdkInt >= Android.OS.BuildVersionCodes.Kitkat)
{
WebView.SetWebContentsDebuggingEnabled(true);
}
webView = new Android.Webkit.WebView(this.Context);
webView.Settings.JavaScriptEnabled = true;
webView.SetWebViewClient(new Client(this));
webView.SetWebChromeClient(new ChromeClient());
webView.SetLayerType(LayerType.Software, null);
webView.Settings.UseWideViewPort = true;
webView.Settings.LoadWithOverviewMode = true;
webView.LoadUrl("file:///android_asset/View.html");
var x = webView.IsHardwareAccelerated; // returns false
Any ideas or pointers please?
WebView- SquonkActivitycontent. If Xamarin doesn't use those then I can't give any help. - Squonk