我在哪里可以找到一个简单可编译的示例,演示如何创建和使用UIWebView?
是否有任何非界面构建器的示例?
我在哪里可以找到一个简单可编译的示例,演示如何创建和使用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];