I am working on a small Xamarin.Forms web viewer application. This is the next question to the previous one, xamarin-forms-making-webview-go-back
So, I have a toolbar and the back button is implemented and working. But when I start the program with the emulator already open (im using Genymotion), the program starts and shows the toolbar along with the back button ... but the web view is not displayed.
But this is strange, sometimes when I run the program when the emulator is in sleep mode and then switches back to the program, it works fine. Also, when I tested it on iOS, it just showed the toolbar and didn't browse the website at all! Most often this is not, the emulator simply will not show webView. I also tested this on my Android device, and the same thing happens, itll show the toolbar, but not the webview.
I donβt understand what I understand, but can anyone help me with this.
I will attach my code below:
App.cs
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Xamarin.Forms; namespace WebView_form { public class App : Application { public App() {
WebPage.cs
using System; using System.Collections.Generic; using System.Linq; using System.Reflection.Emit; using System.Text; using Xamarin.Forms; namespace WebView_form { public class WebPage : ContentPage { private WebView webView; public WebPage() { webView = new WebView { Source = "https://www.google.com" };
If anyone can help me, it would be great.
source share