首页 > 代码库 > UIWebView控件

UIWebView控件

用处:实现一个web浏览器,加载静态html,动态url,调用js

//加载动态url

self.webView = [[UIWebView alloc]initWithFrame:self.view.bounds];

NSString *str = @"http://www.baidu.com";

NSURL *url = [NSURL URLWithString:str];

NSURLRequest *request = [NSURLRequest requestWithURL:url];

[self.webView loadRequest: request];