iOS简单加载一个网页

.h文件中

 

@property(strong ,nonitomic) UIWebView * webView;

 

.m文件中

 

-(void)viewDidLoad

{

 

    self.webview = [[UIWebView alloc]initWithFormat:CGRectmake(0,0,320,480)];

     

    [self.view addSubview:self.webView];

 

 

    NSUrlRequeast * request = [NSURLRequest requestWithUrl:[NSURL urlWithString:"http://www.baidu.com"]];

 

  //运行一下,百度页面就出来了

 

   [self.webview loadRequest:request];

  

 

}

原文地址:https://www.cnblogs.com/dyllove98/p/3235335.html