示例#1
0
 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;
 }
示例#2
0
 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);
 }
示例#3
0
        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());
        }