How to implement a webview in Xamarin.Forms


Web Viewis a handy component to load web content. In some cases, you want to display a single web page locally in your app or let users access external web pages within your app. You can simply embed the Web View object in your app and send it a request to load the web content.

In this demo we are going to implement a single webview in our application.

Let’s Start:

We are just simply going to add a label and a webview in our application demo.

Create a new Xamarin.Forms solution and name it as “WebViewXamarinForms”.
Create a new ContentPage file and name it as WebViewPage, add NavigationPage to it.

Now in WebViewPage.cs:

Now try to build and run the app.
In iOS it will run without changes but for Android you have to add permission for Internet in AndroidMenifest.xml file.



If you like this tutorial then you can download full copy of the code from github

1 Comment to How to implement a webview in Xamarin.Forms

  1. how can we use the web services data in web view in xamarin.forms.
    i want to interaction between webview in xamarin.forms and web services.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">