You could have a try with code as follows:
public class NavigationDelegat : WKNavigationDelegate
{
public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
{
string Size = "300%";
string textSize = String.Format(@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '{0}'", Size);
string TextColor = "#ffffff";
string textColor = String.Format(@"document.getElementsByTagName('body')[0].style.webkitTextFillColor = '{0}'", TextColor);
WKJavascriptEvaluationResult handler = (NSObject result, NSError err) => {
if (err != null)
{
System.Console.WriteLine(err);
}
if (result != null)
{
System.Console.WriteLine(result);
}
};
webView.EvaluateJavaScript(textSize , handler);
webView.EvaluateJavaScript(textColor, handler);
webView.Opaque = false;
webView.BackgroundColor = UIColor.Clear;
}
}
============================Update=============================
private class WKwebviewdeleagte : WKNavigationDelegate
{
public override void DidFinishNavigation(WKWebView webView, WKNavigation navigation)
{
base.DidFinishNavigation(webView, navigation);
if(UIDevice.CurrentDevice.CheckSystemVersion(13, 0))
{
string Size = "300%";
string TextSize = String.Format(@"document.getElementsByTagName('body')[0].style.webkitTextSizeAdjust= '{0}'", Size);
string TextColor;
string BackgroundColor;
if (UITraitCollection.CurrentTraitCollection.UserInterfaceStyle == UIUserInterfaceStyle.Light)
{
string textColor = "#666666";
TextColor = String.Format(@"document.getElementsByTagName('body')[0].style.webkitTextFillColor = '{0}'", textColor);
string backgroundColor = "\"#FFFFFF\"";
BackgroundColor = String.Format(@"document.body.style.backgroundColor='{0}'", backgroundColor);
}
else
{
string textColor = "#ffffff";
TextColor = String.Format(@"document.getElementsByTagName('body')[0].style.webkitTextFillColor = '{0}'", textColor);
string backgroundColor = "\"#001A1A\"";
BackgroundColor = String.Format(@"document.body.style.backgroundColor='{0}'", backgroundColor);
}
WKJavascriptEvaluationResult handler = (NSObject result, NSError err) => {
if (err != null)
{
System.Console.WriteLine(err);
}
if (result != null)
{
System.Console.WriteLine(result);
}
};
webView.EvaluateJavaScript(TextSize, handler);
webView.EvaluateJavaScript(TextColor, handler);
webView.EvaluateJavaScript(BackgroundColor, handler);
//webView.Opaque = false;
//webView.BackgroundColor = UIColor.Clear;
}
}
}