相关疑难解决方法(0)

如何在xamarin表单webview中加载本地html文件

我正在尝试加载一个 html 文件,该文件与我正在使用的类位于同一路径中,当我运行应用程序时,通过 xamarin 表单中的 Web 视图,我得到一个白屏,并且没有加载任何内容,这是我的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms;

namespace App.Plan
{
    public partial class Tornado : ContentPage
    {
        public Tornado()
        {
            InitializeComponent();
            var browser = new WebView
            {
                Source = "local.html"
};
    }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# xamarin xamarin.forms

2
推荐指数
1
解决办法
9332
查看次数

标签 统计

c# ×1

xamarin ×1

xamarin.forms ×1