您的位置:首页 > 移动开发

Snail—UI学习浏览器控件UIWebView

2015-07-30 15:13 323 查看
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor cyanColor];
[self createWebView];
}

- (void)createWebView{

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

//根据字符串网络地址 创建一个NSURL
NSURL * url = [NSURL URLWithString:@"http://blog.csdn.net/qq1791422018"];
//网络的请求
NSURLRequest * request = [NSURLRequest requestWithURL:url];

//设置属性  加载请求 然后百度的页面就显示在webView这个区域
[webView loadRequest:request];

[self.view addSubview:webView];

}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: