See Also: WebView Members
The following example shows a basic use.
C# Example
using System;
using Xamarin.Forms;
namespace FormsGallery
{
class WebViewDemoPage : ContentPage
{
public WebViewDemoPage()
{
Label header = new Label
{
Text = "WebView",
Font = Font.BoldSystemFontOfSize(50),
HorizontalOptions = LayoutOptions.Center
};
WebView webView = new WebView
{
Source = new UrlWebViewSource
{
Url = "http://blog.xamarin.com/",
},
VerticalOptions = LayoutOptions.FillAndExpand
};
// Accomodate iPhone status bar.
this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);
// Build the page.
this.Content = new StackLayout
{
Children =
{
header,
webView
}
};
}
}
}