技术开发 频道

新手必读:iPhone SDK示例代码解析

  Web view

  UIWebView类的调用.

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.google.com";
NSURL
*url = [NSURL URLWithString:urlAddress];
NSURLRequest
*requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self addSubview:webView];
[webView release];
0
相关文章