Got problem when uploading the html into the webview in iphone sdk.

Posted by Monish Kumar on Stack Overflow See other posts from Stack Overflow or by Monish Kumar
Published on 2011-01-03T08:49:37Z Indexed on 2011/01/03 8:53 UTC
Read the original article Hit count: 263

Filed under:
|
|

Hi Guy's

NSString* appendString=@"";
    appendString = [appendString stringByAppendingString:@"<body>"];
    appendString =[appendString stringByAppendingString:@"<table background='footer.png' width='320' height='45' style='background-repeat:no-repeat'>"];
    appendString =[appendString stringByAppendingString:@"<tr>"];
    appendString =[appendString stringByAppendingString:@"<td align='left' width='57' height='31' style='padding: 6px 0 0 0' ><a href='/map/'><img src='details_Back.png'/></a></td>"];
    appendString =[appendString stringByAppendingString:@"<td align='left' valign='middle' style='padding: 0 0 0 65px; font-family:Helvetica; font-size:21px ; font-weight:bold ; color:#FFF'>Details</td>"];
    appendString =[appendString stringByAppendingString:@"</tr>"];
    appendString =[appendString stringByAppendingString:@"</table>"];

    appendString =[appendString stringByAppendingString:@"<br>"];
    returnString = [returnString stringByReplacingOccurrencesOfString:@"<body>" withString:appendString];
    printf("\n return string :%s",[returnString UTF8String]);
    [myWebView loadHTMLString:returnString baseURL:[NSURL URLWithString:@"http://abc.api.abcdefg.com/"]];

here in the above code the footer.png and details_back.png are the local images stored in my resource folder.

Here the problem is I am gettin the background image from the server link I had passed to the webview as baseurl but the images footer.png and details_back.png which were stored in resource is not displayed.

if I use the resource bundle as the baseurl then I am not displayed the background image from the server link.

Can anyone please give me the suggestions to get rid of rid of this problem.

thanks to all guy's, Monish.

© Stack Overflow or respective owner

Related posts about html

Related posts about objective-c