Edit your code as follows. First wrap MainPage in NavigationPage to make the toolbar visible.
It basically boils down to creating a variable that makes it easier to access your WebView .
Then create a button in the ToolbarItems collection that can trigger the event. And in this case, you can call the already available GoBack() method on the WebView .
You probably want to check out the Xamarin documentation on WebView , it is probably a good idea to check if you can really go back with the CanGoBack property.
Note that I assigned BackIcon.png , you can replace it with null or your own icon, of course. Also, the code has not been tested, it's just because of the head, so maybe some half-columns or something else are missing.
App.cs
// ... other code public App() { // The root page of your application MainPage = new NavigationPage(new WebPage()); } // ... other code
WebPage.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; using System.Text; using Xamarin.Forms; namespace DisplayWebPage { public class WebPage : ContentPage { private WebView _webView; public WebPage() {
source share