private void WebView_LoadStarted(object sender, EventArgs e) { if (activityIndicator == null) { activityIndicator = new UIActivityIndicatorView(UIActivityIndicatorViewStyle.WhiteLarge); activityIndicator.Center = ActivityIndicatorPosition; } activityIndicator.StartAnimating(); GameView.AddSubview(activityIndicator); isActivityIndicatorVisible = true; }
public WebBrowser() { webView = new UIWebView { AutoresizingMask = UIViewAutoresizing.FlexibleDimensions, ScalesPageToFit = true, Opaque = false, BackgroundColor = UIColor.Black, Hidden = true, }; webView.ScrollView.Bounces = false; webView.ScrollView.BouncesZoom = false; webView.LoadStarted += WebView_LoadStarted; webView.LoadFinished += WebView_LoadFinished; GameView.AddSubview(webView); }
public WebBrowser() { webView = new WKWebView(CoreGraphics.CGRect.Empty, new WKWebViewConfiguration()) { AutoresizingMask = UIViewAutoresizing.FlexibleDimensions, Opaque = false, BackgroundColor = UIColor.Black, Hidden = true, }; webView.ScrollView.Bounces = false; webView.ScrollView.BouncesZoom = false; var webViewDelegate = new WebBrowserDelegate(); webViewDelegate.LoadStarted += WebView_LoadStarted; webViewDelegate.LoadFinished += WebView_LoadStarted; webView.NavigationDelegate = webViewDelegate; GameView.AddSubview(webView); Components.Add(new UpdatableNodeBehavior()); }