Note that there are some explanatory texts on larger screens.

plurals
  1. POGot problem when uploading the html into the webview in iphone sdk
    text
    copied!<pre><code> NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:loadUrl]]; NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSMutableString *returnString = [[NSMutableString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; NSString *absString = [[NSBundle mainBundle]pathForResource:@"footer" ofType:@"png"]; NSURL *footerURL = [NSURL fileURLWithPath:absString]; NSString* appendString=@""; appendString = [appendString stringByAppendingString:@"&lt;body&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;table background='footer.png' width='320' height='45' style='background-repeat:no-repeat'&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;tr&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;td align='left' width='57' height='31' style='padding: 6px 0 0 0' &gt;&lt;a href='/map/'&gt;&lt;img src='details_Back.png'/&gt;&lt;/a&gt;&lt;/td&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;td align='left' valign='middle' style='padding: 0 0 0 65px; font-family:Helvetica; font-size:21px ; font-weight:bold ; color:#FFF'&gt;Details&lt;/td&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;/tr&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;/table&gt;"]; appendString =[appendString stringByAppendingString:@"&lt;br&gt;"]; //returnString = [returnString stringByReplacingOccurrencesOfString:@"&lt;body&gt;" withString:appendString]; [returnString replaceOccurrencesOfString:@"&lt;body&gt;" withString:appendString options:NSCaseInsensitiveSearch range:NSMakeRange(0, [returnString length])]; [returnString replaceOccurrencesOfString:@"footer.png" withString:[footerURL absoluteString] options:NSCaseInsensitiveSearch range:NSMakeRange(0, [returnString length])]; printf("\n return string :%s",[returnString UTF8String]); [myWebView loadHTMLString:returnString baseURL:[NSURL URLWithString:@"http://abc.api.abcdef.com"]]; </code></pre> <p>here in the above code the footer.png and details_back.png are the local images stored in my resource folder.</p> <p>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.</p> <p>if I use the resource bundle as the baseurl then I am not displayed the background image from the server link.</p> <p>Can anyone please give me the suggestions to get rid of rid of this problem.</p> <p>thanks to all guy's, Monish. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload