forked from hussien89aa/XamarinAndroidTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWebView.cs
26 lines (21 loc) · 749 Bytes
/
WebView.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// setting layout
Button button = FindViewById<Button>(Resource.Id.MyButton);
WebView webv1 = FindViewById<WebView>(Resource.Id.webView1);
webv1.Settings.JavaScriptEnabled = true;
webv1.LoadUrl("http://news.alruabye.net/");
webv1.Settings.LoadWithOverviewMode = true;
webv1.SetWebViewClient(new HelloWebViewClient());
webv1.GoBack();
//webv1.GoForward();
//load url inside
public class HelloWebViewClient : WebViewClient
{
public override bool ShouldOverrideUrlLoading(WebView view, string url)
{
view.LoadUrl(url);
return true;
}
public override void OnPageFinished(WebView view, string url)
{
}
}