How can I use WKWebView instead of UIWebView in Xamarin Forms WebView (iOS)

I am working on developing mobile applications using Xamarin.Forms (PCL). I am using Xamarin WebView to display the contents of a web view and I am getting a performance issue in an iOS application. So, I analyzed and found that WKWebView will improve performance.

How can I use WKWebView in Xamarin Forms WebView instead of UIWebView? Is there any custom rendering for this?

+5
source share
1 answer

Yes, you can create your own rendering using WKWebView.

Please see below and this is the ios rendering class for WebView:

[assembly: ExportRenderer(typeof(CustomWebView), typeof(CustomWebViewRenderer))] namespace DemoApp.iOS.Renderers { public class CustomWebViewRenderer : ViewRenderer<CustomWebView, WKWebView> { protected override void OnElementChanged(ElementChangedEventArgs<CustomWebView> e) { base.OnElementChanged(e); } } } 

For more information click here .

+5
source

Source: https://habr.com/ru/post/1264822/


All Articles