【发布时间】:2010-07-22 00:25:35
【问题描述】:
在哪里可以找到关于如何创建和使用 UIWebView 的简单可编译示例?
任何非接口构建器示例?
【问题讨论】:
-
干脆放弃学习Objective-C和Interface Builder。这是一个苛刻的建议,但如果你想编写一个 iPhone 应用程序,这是不可避免的。将其视为学习新语言和新视角的一种方式。
标签: objective-c iphone uiwebview
在哪里可以找到关于如何创建和使用 UIWebView 的简单可编译示例?
任何非接口构建器示例?
【问题讨论】:
标签: objective-c iphone uiwebview
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[webView setDelegate:self];
NSString *urlAddress = @"http://www.google.com/";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
【讨论】:
WebView - Add the Delegate
@property (strong, nonatomic) IBOutlet UIWebView *WebView;
NSString *fullURL = @"http://facebook.com/";
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[_WebView loadRequest:requestObj];
【讨论】: