【发布时间】:2022-07-27 17:50:00
【问题描述】:
我正在创建一个 webview,它将加载我的 url 链接,例如“http://test.rf.gd/index”,但是当我尝试在 webview xamarin 中加载它时它没有加载它说 net::ERR_CLEARTEXT_NOT_PERMITTED
我创建了一个新的 Cookie webview,但它也不起作用
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Text;
using System.Net;
using System.Web;
using Xamarin.Forms;
namespace OMA.WebCookie
{
public class CookieWebView : WebView
{
public static readonly BindableProperty UrlProperty = BindableProperty.Create(propertyName: "Url", returnType: typeof(string), declaringType: typeof(CookieWebView), defaultValue: default(string));
public string Url
{
get { return (string)GetValue(UrlProperty); }
set { SetValue(UrlProperty, value); }
}
public CookieCollection Cookies
{ get; protected set; }
}
public enum CookieNavigationMode
{
Back,
Forward,
New,
Refresh,
Reset
}
}
如何在 xamarin webview 中加载 http 链接?
【问题讨论】: