Вот мой WebViewPage.xaml
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="IntentoAssociates.WebViewPage">
<Grid>
<!-- Place new controls here -->
<WebView x:Name="WebV"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
<ActivityIndicator x:Name="BusyIndicator"
HorizontalOptions="Center"
VerticalOptions="Center"
Color="Red"
HeightRequest="50"
WidthRequest="50" />
</Grid>
</ContentPage>
А вот мой WebViewPage.xaml.cs
using System;
using System.Collections.Generic;
using Xamarin.Forms;
namespace IntentoAssociates
{
public partial class WebViewPage : ContentPage
{
public WebViewPage()
{
InitializeComponent();
Title = "Intento Associates";
BusyIndicator.IsRunning = BusyIndicator.IsVisible = true;
WebV.Source = "https://www.turkishairlines.com/";
WebV.Navigating += WebV_Navigating;
WebV.Navigated += WebV_Navigated;
}
private void WebV_Navigated(object sender, WebNavigatedEventArgs e)
{
BusyIndicator.IsRunning = BusyIndicator.IsVisible = false;
}
private void WebV_Navigating(object sender, WebNavigatingEventArgs e)
{
BusyIndicator.IsRunning = BusyIndicator.IsVisible = true;
}
}
}
Я использую формы Xamarin 4.1.555618 во всех моих проектах иПожары Навигация только один раз, когда страница загружена. Вы можете проверить код и сообщить мне, если у вас есть какие-либо проблемы. Удачного кодирования !!!