Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jimmgarrido
Created March 1, 2017 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmgarrido/b3a1bd8fc130435b53f62cb5736368a9 to your computer and use it in GitHub Desktop.
Save jimmgarrido/b3a1bd8fc130435b53f62cb5736368a9 to your computer and use it in GitHub Desktop.
Android AllowUniversalAccessFromFileURLs
using System;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
namespace WebviewDemo.Droid
{
public class CustomWebViewRenderer : WebViewRenderer
{
protected override void OnElementChanged(ElementChangedEventArgs<WebView> e)
{
base.OnElementChanged(e);
if (Control != null)
Control.Settings.AllowUniversalAccessFromFileURLs = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment