[英]How to open links in UIWebView in iphone
我想在我的应用程序中打开一个链接,我不想很好地关闭我的应用程序。 我在应用程序顶部有导航栏,在导航下方我想打开我的 web 视图。 我已经定义了我的出口。
IBOutlet UIWebView *displaySingleData;
我将如何在我的应用程序中打开链接。
提前致谢
NSString *urlAddress = @”http://www.google.com”;
//Create a URL object.
NSURL *url = [NSURL URLWithString:urlAddress];
//URL Requst Object
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
//Load the request in the UIWebView.
[webView loadRequest:requestObj];
只需编写以下代码:
[displaySingleData loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com"]]];
快乐的编码..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.