【发布时间】:2018-01-11 10:41:39
【问题描述】:
听起来很简单,但由于某种原因,它不适合我。我有以下代码:
string rootPath = DependencyService.Get<IBaseUrl>().Get();
var source = new UrlWebViewSource
{
Url = System.IO.Path.Combine(rootPath, "Index.html")
};
browser.Source = source;
IBaseUrl 在 android 上的实现代码是
public class BaseUrl : IBaseUrl
{
public string Get()
{
return "file:///android_asset/Content/";
}
}
还尝试从 url 中删除“内容”,但仍然无法正常工作。
【问题讨论】:
标签: webview xamarin.forms