当前位置: 首页>>代码示例>>C#>>正文


C# UIWebView.GoForward方法代码示例

本文整理汇总了C#中UIWebView.GoForward方法的典型用法代码示例。如果您正苦于以下问题:C# UIWebView.GoForward方法的具体用法?C# UIWebView.GoForward怎么用?C# UIWebView.GoForward使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIWebView的用法示例。


在下文中一共展示了UIWebView.GoForward方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            this.NavigationController.NavigationBar.BarStyle = UIBarStyle.BlackOpaque;
            this.NavigationController.NavigationBar.TintColor = UIColor.White;
            this.NavigationController.NavigationBar.BarTintColor = UIColor.FromRGB (0, 176, 202);
            this.NavigationController.NavigationBar.TitleTextAttributes = new UIStringAttributes()
            {
                ForegroundColor = UIColor.White
            };

            Title = "Yagbani";
            View.BackgroundColor = UIColor.White;

            webView = new UIWebView(View.Bounds);
            View.AddSubview(webView);

            var url = "http://yagbaniac14.wix.com/aquacultureknowledgeproject";
            webView.LoadRequest (new NSUrlRequest (new NSUrl (url)));

            webView.ScalesPageToFit = true;

            this.SetToolbarItems( new UIBarButtonItem[] {
                new UIBarButtonItem(UIBarButtonSystemItem.Refresh, (s,e) => {
                    webView.Reload();
                })
                , new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) { Width = 10 }
                , new UIBarButtonItem("Home", UIBarButtonItemStyle.Plain, (s,e) => {
                    webView.LoadRequest(new NSUrlRequest (new NSUrl (url)));
                })
                , new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) { Width = 10 }
                , new UIBarButtonItem(UIBarButtonSystemItem.Rewind, (s,e) => {
                    webView.GoBack();
                })
                , new UIBarButtonItem(UIBarButtonSystemItem.FastForward, (s,e) => {
                    webView.GoForward();
                })
            }, false);

            this.NavigationController.ToolbarHidden = false;
            this.NavigationController.Toolbar.TintColor = UIColor.Black;
        }
开发者ID:Jusliang,项目名称:Ma-Phrase-Book,代码行数:42,代码来源:IwaidjaInymanScreen.cs

示例2: ViewDidLoad

        public override void ViewDidLoad()
        {
            var placeholderView = new UIView(new RectangleF(0, 0, 34, 44));
            _rightPlaceholderButton = new UIBarButtonItem(placeholderView);
            NavigationItem.RightBarButtonItem = _rightPlaceholderButton;

            base.ViewDidLoad();

            View.UserInteractionEnabled = true;
            View.MultipleTouchEnabled = true;

            _webView = new UIWebView();
            _webView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            _webView.UserInteractionEnabled = true;
            _webView.MultipleTouchEnabled = true;
            _webView.Delegate = new WebDelegate();
            _webView.ScalesPageToFit = true;

            _webView.LoadStarted += delegate {
                _refreshButton.Enabled = false;
                UpdateNavButtons ();
            };

            _webView.LoadFinished += delegate {
                _refreshButton.Enabled = true;
                UpdateNavButtons ();
                UpdateTitle ();
            };

            _webView.LoadError += (webView, error) => {
                Console.WriteLine ("Failed " + error.Error.ToString ());
                BTProgressHUD.ShowErrorWithStatus ("Failed to load page");

                NSTimer.CreateScheduledTimer(2d, delegate {
                    BTProgressHUD.Dismiss ();
                });
            };

            View.AddSubview(_webView);

            _bottomToolbar = new UIToolbar();
            _bottomToolbar.AutoresizingMask = UIViewAutoresizing.FlexibleWidth;
            View.AddSubview(_bottomToolbar);

            _navigateBackButton = new UIBarButtonItem(UIImage.FromFile("back.png"), UIBarButtonItemStyle.Plain, delegate {
                _webView.GoBack();
            });

            _navigateForwardButton = new UIBarButtonItem(UIImage.FromFile("forward.png"), UIBarButtonItemStyle.Plain, delegate {
                _webView.GoForward();
            });

            _refreshButton = new UIBarButtonItem(UIBarButtonSystemItem.Refresh, delegate {
                _webView.Reload();
            });

            _bottomToolbar.SetItems(new [] {
                _navigateBackButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FixedSpace) { Width = 5 },
                _navigateForwardButton,
                new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace),
                _refreshButton },
            false);
        }
开发者ID:jivkopetiov,项目名称:StackApp,代码行数:64,代码来源:WebBrowserController.cs


注:本文中的UIWebView.GoForward方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。