<i id='hinL2'><tr id='hinL2'><dt id='hinL2'><q id='hinL2'><span id='hinL2'><b id='hinL2'><form id='hinL2'><ins id='hinL2'></ins><ul id='hinL2'></ul><sub id='hinL2'></sub></form><legend id='hinL2'></legend><bdo id='hinL2'><pre id='hinL2'><center id='hinL2'></center></pre></bdo></b><th id='hinL2'></th></span></q></dt></tr></i><div id='hinL2'><tfoot id='hinL2'></tfoot><dl id='hinL2'><fieldset id='hinL2'></fieldset></dl></div>

        <small id='hinL2'></small><noframes id='hinL2'>

        <tfoot id='hinL2'></tfoot>
          <bdo id='hinL2'></bdo><ul id='hinL2'></ul>
      1. <legend id='hinL2'><style id='hinL2'><dir id='hinL2'><q id='hinL2'></q></dir></style></legend>

        UIWebView 上的后退按钮

        Back Button on UIWebView(UIWebView 上的后退按钮)
          <tbody id='rzRde'></tbody>
        <legend id='rzRde'><style id='rzRde'><dir id='rzRde'><q id='rzRde'></q></dir></style></legend>

        <small id='rzRde'></small><noframes id='rzRde'>

        • <i id='rzRde'><tr id='rzRde'><dt id='rzRde'><q id='rzRde'><span id='rzRde'><b id='rzRde'><form id='rzRde'><ins id='rzRde'></ins><ul id='rzRde'></ul><sub id='rzRde'></sub></form><legend id='rzRde'></legend><bdo id='rzRde'><pre id='rzRde'><center id='rzRde'></center></pre></bdo></b><th id='rzRde'></th></span></q></dt></tr></i><div id='rzRde'><tfoot id='rzRde'></tfoot><dl id='rzRde'><fieldset id='rzRde'></fieldset></dl></div>

                <tfoot id='rzRde'></tfoot>
                  <bdo id='rzRde'></bdo><ul id='rzRde'></ul>
                • 本文介绍了UIWebView 上的后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试图弄清楚如何创建一个允许用户返回一页的后退按钮.我通读了 Apple 的 Docs(它仍然超出我的想象),发现我需要设置 canGoBackgoBack 的.我已经尝试过了,但由于某种原因它不起作用.我的 UIWebView 被命名为 viewWeb,我创建了一个插座并将其附加到我的后退按钮上,命名为 backButton,并将其标记为 1.这里是我在 View Controller 中编写的代码:

                  I'm trying to figure out how to create a back button that allows the user to go back one page. I read through Apple's Docs (which still go way over my head) and found out that I need to setup the canGoBack and goBack's. I have tried this, but for some reason it is not working. My UIWebView is named viewWeb, and I created and attached an outlet to my Back button, named backButton, and also tagged it as 1. Here is my code that I wrote in the View Controller:

                  // Back button:
                  -(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
                      if (buttonIndex == 1) {
                  
                          [_backButton addTarget:_viewWeb
                                           action:@selector(goBack)
                                 forControlEvents:UIControlEventTouchDown];
                  
                          if ([_viewWeb canGoBack]) {
                  
                              NSLog(@"Back button pressed.");
                              [_viewWeb goBack];
                          }
                      }
                  
                      else return;
                  }
                  

                  有人知道我需要更改/添加什么才能使其正常工作吗?

                  Does anyone know what I need to change / add to get this working?

                  推荐答案

                  actionSheet:clickedButtonAtIndex: 适用于 UIActionSheet 对象,而非 UIButton 动作.

                  actionSheet:clickedButtonAtIndex: is for UIActionSheet objects, not UIButton actions.

                  您可能应该编写一个如下所示的 IBAction 方法:

                  You should probably write an IBAction method that looks something like this:

                  - (IBAction)backButtonTapped:(id)sender {
                     [_viewWeb goBack];
                  }
                  

                  并将其连接到按钮的 Touch Up Inside 操作.

                  and connect it to the Touch Up Inside action from the button.

                  您可以在 IBAction 上搜索更多信息,但这可能正是您想要的

                  You can search for more info on IBAction but that's likely what you want

                  这篇关于UIWebView 上的后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  iOS UIWebView app opens link in Safari(iOS UIWebView 应用在 Safari 中打开链接)
                  Close UIWebView using javascript:window.close();(使用 javascript:window.close() 关闭 UIWebView;)
                  NSCachedURLResponse returns object, but UIWebView does not interprets content(NSCachedURLResponse 返回对象,但 UIWebView 不解释内容)
                  Trouble hiding iAd banner and displaying UIWebView in its place(无法隐藏 iAd 横幅并在其位置显示 UIWebView)
                  Knowing when AJAX has loaded in UIWebView(知道何时在 UIWebView 中加载了 AJAX)
                  Load image/logo in existing HTML input field - UIWebView(在现有的 HTML 输入字段中加载图像/徽标 - UIWebView)
                  <legend id='2jEBY'><style id='2jEBY'><dir id='2jEBY'><q id='2jEBY'></q></dir></style></legend>
                  • <bdo id='2jEBY'></bdo><ul id='2jEBY'></ul>
                  • <small id='2jEBY'></small><noframes id='2jEBY'>

                    <tfoot id='2jEBY'></tfoot>
                    <i id='2jEBY'><tr id='2jEBY'><dt id='2jEBY'><q id='2jEBY'><span id='2jEBY'><b id='2jEBY'><form id='2jEBY'><ins id='2jEBY'></ins><ul id='2jEBY'></ul><sub id='2jEBY'></sub></form><legend id='2jEBY'></legend><bdo id='2jEBY'><pre id='2jEBY'><center id='2jEBY'></center></pre></bdo></b><th id='2jEBY'></th></span></q></dt></tr></i><div id='2jEBY'><tfoot id='2jEBY'></tfoot><dl id='2jEBY'><fieldset id='2jEBY'></fieldset></dl></div>
                      <tbody id='2jEBY'></tbody>