зеркало из https://github.com/DeGsoft/maui-linux.git
don't setup webview if running as designer (#6592)
This commit is contained in:
Родитель
578d0f92a4
Коммит
3a5614bead
|
@ -17,14 +17,14 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
WebViewClient _webViewClient;
|
||||
FormsWebChromeClient _webChromeClient;
|
||||
|
||||
bool _isDisposed = false;
|
||||
protected internal IWebViewController ElementController => Element;
|
||||
protected internal bool IgnoreSourceChanges { get; set; }
|
||||
protected internal string UrlCanceled { get; set; }
|
||||
|
||||
public WebViewRenderer(Context context) : base(context)
|
||||
{
|
||||
AutoPackage = false;
|
||||
AutoPackage = false;
|
||||
}
|
||||
|
||||
[Obsolete("This constructor is obsolete as of version 2.5. Please use WebViewRenderer(Context) instead.")]
|
||||
|
@ -62,6 +62,10 @@ namespace Xamarin.Forms.Platform.Android
|
|||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (_isDisposed)
|
||||
return;
|
||||
|
||||
_isDisposed = true;
|
||||
if (disposing)
|
||||
{
|
||||
if (Element != null)
|
||||
|
@ -119,6 +123,12 @@ namespace Xamarin.Forms.Platform.Android
|
|||
_webChromeClient.SetContext(Context);
|
||||
webView.SetWebChromeClient(_webChromeClient);
|
||||
|
||||
if(Context.IsDesignerContext())
|
||||
{
|
||||
SetNativeControl(webView);
|
||||
return;
|
||||
}
|
||||
|
||||
webView.Settings.JavaScriptEnabled = true;
|
||||
webView.Settings.DomStorageEnabled = true;
|
||||
SetNativeControl(webView);
|
||||
|
|
Загрузка…
Ссылка в новой задаче