我正在使用「loadHTMLString」創建一個webview和加載內容內容正在加載我只是無法讓鏈接工作,因爲鏈接到google.com。任何幫助都會很棒。帶鏈接的UIWebView
UIWebView* newWeb = [[UIWebView alloc initWithFrame:CGRectMake(notificationPopUp.frame.origin.x+ 20,notificationPopUp.frame.origin.y-100,100, 100)];
//newWeb.backgroundColor = [UIColor clearColor];
newWeb.alpha = 0.7;
newWeb.opaque= NO;
newWeb.delegate= self;
NSString *html = [NSString stringWithFormat:@"<html><head><title></title><style type=\"text/css\">a{text-decoration:none}</style></head><body><FONT COLOR=\"#484848\"><p>Hello this is a <a href=\"http://www.google.com\">Test</a></p></FONT></body></html>"];
[newWeb loadHTMLString:html baseURL:[NSURL URLWithString:@""]];
newWeb.userInteractionEnabled= TRUE;
[notificationPopUp addSubview:newWeb];
鏈接是否指向存儲在應用程序捆綁中的資源? – 2009-11-19 21:46:31
關於a)您期望鏈接所做的事情和b)您對目前所做事情的觀察將有所幫助。 – fbrereto 2009-11-19 21:51:39
在這個例子中我只是想去谷歌。主要是我只想鏈接到網站。 – wolffang 2009-11-19 22:04:19