Html
page content on being load Webview
using LoadDataWithBaseURL
and it displays a page which I need. In this page when I click a button, it takes me to second page. Only second page having problem, this is just displaying plain html
controls, there is no CSS
.
Left screenshot is coming and right one is expected
Below is the Webview sample code
Control.SetWebViewClient(new JavascriptWebViewClient(this, $"javascript: {JavascriptFunction}"));
Control.AddJavascriptInterface(new JSBridge(this), "jsBridge");
Control.Settings.AllowFileAccess = true;
Control.Settings.JavaScriptEnabled = true;
Control.Settings.AllowFileAccessFromFileURLs = true;
Control.Settings.AllowUniversalAccessFromFileURLs = true;
Control.Settings.AllowContentAccess = true;
Control.Settings.DomStorageEnabled = true;
Control.SetWebChromeClient(new WebChromeClient());
Control.LoadDataWithBaseURL("https://service.force.com/embeddedservice/5.0/esw.min.js", content1, "text/html; charset=utf-8", "UTF-8", null);
here the content loading on Webview
initially which has html
and JavaScript
.
How can I fix this issue ?
Edit 1 : This is how I am trying to load styles
inside head tag
of above mentioned html content file. I tried many combination using rel type
also. Nothing seem to be working.
//1
<base href="/">
<link href="file:///android_asset/salesforce-lightning-design-system_touch-demo.css" type="text/css"/>
//2
<base href="/">
<link href="salesforce-lightning-design-system_touch-demo.css" type="text/css"/>
//3
<base href="/">
<link href="file:///android_asset/salesforce-lightning-design-system_touch-demo.css" type="text/css" crossorigin="anonymous" />
//4
<link href="salesforce-lightning-design-system_touch-demo.css" type="text/css" />
//5
<link href="/salesforce-lightning-design-system_touch-demo.css" type="text/css">
//6
<link href="file:///android_asset/salesforce-lightning-design-system_touch-demo.css" type="text/css" />
When I tried <link rel="stylesheet" href="test.css" />
, its working in chrome browser
but not working in mobile application.