0
我正在實現一個UIWebView。在這我只需要顯示兩個圖像。一個來自服務器路徑,一個是本地的。如果我將baseURL指向服務器,如果將服務器映像更改爲Bundle url,則加載服務器映像,它僅加載本地映像。我不知道究竟是什麼錯。請查看我的代碼,請讓我知道我是否犯了錯誤。未加載UIWebView中的圖像
NSString *absStirng=[[[NSBundle mainBundle] resourceURL] absoluteString];
appendString =[appendString stringByAppendingString:@"<html>"];
appendString =[appendString stringByAppendingString:@"<body>"];
appendString =[appendString stringByAppendingString:@"<a href='/#/'><img src="];
appendString =[appendString stringByAppendingString:absStirng];
appendString =[appendString stringByAppendingString:@"image.png /></a>"];
appendString =[appendString stringByAppendingString:@"<a href='/#/'><img src="];
appendString =[appendString stringByAppendingString:@"image.png /></a>"];
appendString =[appendString stringByAppendingString:@"</body>"];
appendString =[appendString stringByAppendingString:@"</html>"];
[myWebView loadHTMLString:returnString baseURL:[NSURL URLWithString:@"http://serverUrl/"];
[如何在uiwebview中顯示圖像]的確切副本(http://stackoverflow.com/questions/4601711/how-to-display-images-in-the-uiwebview) – 2011-01-05 09:59:20