我在 iPhone 应用程序中工作,使用 Webview 在屏幕底部加载 Addvertisement 并且工作正常,我想当用户选择 WebView 时,它会自动转到浏览器并加载到 iPhone 设备中,如何集成?请帮我
提前致谢
我试过这个:
- (void)viewDidLoad
{
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 430, 320, 50)];
[webView setDelegate:self];
NSString *urlAddress = @"http://www.dasfafa./myadds.html";
NSURL *url = [NSURL URLWithString:urlAddress];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[webView loadRequest:requestObj];
[self.view addSubview:webView];
}
-(void)webViewDidStartLoad:(UIWebView *)webView
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}
-(void)webViewDidFinishLoad:(UIWebView *)webView
{
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
NSString *currentURL = self.AddvertiseWebView.request.URL.absoluteString;
NSLog(@"currentURL:%@",currentURL);
}