我正在使用“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