---
title: "iphone UIWebView 的使用"
author: "ynial"
date: "2011-11-23T14:05:04Z"
tags: []
categories: ["移动开发"]
slug: "iphone-uiwebview"
draft: false
lastmod: "2011-11-23T14:05:04Z"
id: 1274955
url: "https://ynial.iteye.com/blog/1274955"
---

【UIWebView 的使用】

 1：引用外部连接


```objective-c

[super viewdidload];
    CGRect webFrame = CGRectMake(0.0, 0.0, 320.0, 460.0);
    UIWebView *webView = [[uiwebview alloc] initWithFrame:webFrame];
    [webview setbackgroundcolor:[uicolor whitecolor]];
    NSString *urlAddress = @"http://www.baidu.com";
    NSURL *url = [nsurl urlwithstring:urladdress];
    NSURLRequest *requestObj = [nsurlrequest requestwithurl:url];
    [webview loadrequest:requestobj];
    self.view = webView;
 

```