6
votes

I'm working on mobile application development using Xamarin.Forms (PCL). I am using Xamarin WebView to render some web view contents and i'm getting performance issue in iOS application. So, i have analyzed and found that the WKWebView will improve the performance.

How can i use WKWebView in Xamarin Forms WebView instead of UIWebView ? Is there any custom rendering available to do this?

1
No unfortunately there is not a renderer implementing the WKWebView, you will have to do it yourself.pinedax

1 Answers

6
votes

Yes, You can create custom renderer using WKWebView.

Please have a look below and this is ios renderer class of 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 .