簡體   English   中英

如何在 iphone 中打開 UIWebView 中的鏈接

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM