Created
January 10, 2019 12:27
-
-
Save jfversluis/c1e0add7372e5d598c5141b793cf0785 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.Content; | |
using pdfjs.Droid; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.Android; | |
[assembly: ExportRenderer(typeof(WebView), typeof(PdfWebViewRenderer))] | |
namespace pdfjs.Droid | |
{ | |
public class PdfWebViewRenderer : WebViewRenderer | |
{ | |
public PdfWebViewRenderer(Context context) : base(context) | |
{ | |
} | |
protected override void OnElementChanged(ElementChangedEventArgs<WebView> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.NewElement != null) | |
{ | |
Control.Settings.AllowFileAccess = true; | |
Control.Settings.AllowFileAccessFromFileURLs = true; | |
Control.Settings.AllowUniversalAccessFromFileURLs = true; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment