views:

199

answers:

1

I am creating a webview and loading content using "loadHTMLString" The content is loading I just can't get the links to work ex linking to google.com. Any help would be great.

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\"&gt;Test&lt;/a&gt;&lt;/p&gt;&lt;/FONT&gt;&lt;/body&gt;&lt;/html&gt;"];  
[newWeb loadHTMLString:html baseURL:[NSURL URLWithString:@""]]; 
newWeb.userInteractionEnabled= TRUE;
[notificationPopUp addSubview:newWeb];
A: 

I added this code to an empty project and links are clickable. The only thing I can think of is your notificationPopUp view is somehow preventing taps from going to the webview.

duncanwilcox
thanks for narrowing it down, ill find a work around for the popup then
wolffang
yea, I was adding the webview to the button, probably wasn't receiving any touches. Changed it to where it adds it to the mainview.
wolffang