#import "EDRViewController.h"

@interface EDRViewController ()
@property(nonatomic,weak) UIWebView * webView;
@end

@implementation EDRViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    UIWebView * webView=[[UIWebView alloc] initWithFrame:self.view.bounds];
    
    webView.backgroundColor=[UIColor redColor];
    
    [self.view addSubview:webView];
    self.webView=webView;

    [self loadRemoteHTML];
	// Do any additional setup after loading the view, typically from a nib.
}

#pragma mark 加载远程的HTML页面
- (void)loadRemoteHTML {
    NSURL *url = [NSURL URLWithString:@"http://www.baidu.com"];
    [self.webView loadRequest:[NSURLRequest requestWithURL:url]];
}

 ios使用webview浏览指定网页

相关文章:

  • 2022-12-23
  • 2021-07-08
  • 2021-12-03
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2021-07-10
  • 2021-09-02
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-03-11
  • 2021-12-29
  • 2022-12-23
  • 2021-08-07
相关资源
相似解决方案