iphone - Image not set on UIWebview from reference folder(blue folder) -


when trying load image on uiwebview reference folder shows small blue question mark code is:

nsstring *imagepath=[nsstring stringwithformat:@"dataresources/img_0878.jpg"];  [webview loadhtmlstring:[nsstring stringwithformat:@"<img src=\"file://%@\"/>",imagepath] baseurl:nil]; 

and when using same load image on uiimageview works perfectly

code setting image :

uiimage *tile = [uiimage imagenamed:(@"dataresources/img_0878.jpg")];  [imgv setimage:tile];  

please suggest me how can resolve problem

may html string wrong. use this

nsstring *path = [[nsbundle mainbundle] pathforresource:@"img_0878" oftype:@"jpg"]; [webview loadhtmlstring:[nsstring stringwithformat:@"<html><body><img src=\"file://%@\"></body></html>",path] baseurl:nil]; 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -