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

  • <legend id='3w5ey'><style id='3w5ey'><dir id='3w5ey'><q id='3w5ey'></q></dir></style></legend>
      <bdo id='3w5ey'></bdo><ul id='3w5ey'></ul>

    <small id='3w5ey'></small><noframes id='3w5ey'>

      1. 创建 UIWebView 并以编程方式加载网站

        时间:2023-10-22
        <i id='3arS0'><tr id='3arS0'><dt id='3arS0'><q id='3arS0'><span id='3arS0'><b id='3arS0'><form id='3arS0'><ins id='3arS0'></ins><ul id='3arS0'></ul><sub id='3arS0'></sub></form><legend id='3arS0'></legend><bdo id='3arS0'><pre id='3arS0'><center id='3arS0'></center></pre></bdo></b><th id='3arS0'></th></span></q></dt></tr></i><div id='3arS0'><tfoot id='3arS0'></tfoot><dl id='3arS0'><fieldset id='3arS0'></fieldset></dl></div>

          <legend id='3arS0'><style id='3arS0'><dir id='3arS0'><q id='3arS0'></q></dir></style></legend>

          <small id='3arS0'></small><noframes id='3arS0'>

            <bdo id='3arS0'></bdo><ul id='3arS0'></ul>
                  <tbody id='3arS0'></tbody>

                • <tfoot id='3arS0'></tfoot>

                • 本文介绍了创建 UIWebView 并以编程方式加载网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  以下是我的代码.我只是想加载一个网站页面并在屏幕上放一个后退按钮.不知道为什么屏幕上什么也没有显示.

                  The following is my code. I simply want to load a website page and put a back button on screen. Don't know why nothing shows on the screen.

                  在.h中

                  #import <UIKit/UIKit.h>
                  @interface ThirdViewController : UIViewController
                  {
                      UIWebView *myWebView;
                  }
                  @property (nonatomic, retain) UIWebView *myWebView;
                  -(IBAction)goBack:(id)sender;
                  @end
                  

                  在.m

                  #import "ThirdViewController.h"
                  @implementation ThirdViewController
                  @synthesize myWebView;
                  -(IBAction)goBack:(id)sender
                  {
                      [myWebView goBack];
                  }
                  
                  - (void)viewDidLoad
                  {
                      [super viewDidLoad];
                  
                      NSString *urlAddress = @"http://www.apple.com";
                      NSURL *url = [NSURL URLWithString:urlAddress];
                      NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
                      [myWebView loadRequest:requestObj];
                      [self.view addSubview:myWebView];
                  
                      self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]     initWithTitle:@"Back"                                                                              style:UIBarButtonItemStylePlain                                                                         target:self action:@selector(goBack:)];
                  }
                  

                  推荐答案

                  初始化你的 webView.

                  Initialize your webView.

                  UIWebView *tempWebview = [[UIWebView alloc]initWithFrame:theFrame];
                  NSString *urlAddress = @"http://www.apple.com";
                  NSURL *url = [NSURL URLWithString:urlAddress];
                  NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
                  self.myWebView = tempWebview;
                  [tempWebview loadRequest:requestObj];
                  [tempWebview release];
                  myWebView.delegate=self; 
                  

                  这篇关于创建 UIWebView 并以编程方式加载网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:从 UIWebView 访问元数据 下一篇:为 UIWebView 设置委托

                  相关文章

                      <bdo id='A4eU7'></bdo><ul id='A4eU7'></ul>

                      <legend id='A4eU7'><style id='A4eU7'><dir id='A4eU7'><q id='A4eU7'></q></dir></style></legend>
                      <tfoot id='A4eU7'></tfoot>

                    1. <small id='A4eU7'></small><noframes id='A4eU7'>

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