我有一个UIWebView我想在加载图像,但它并没有显示它像我用下面的代码图片无法在UIWebView中加载iphone
pdfView.hidden=NO;
webView.hidden=NO;
pdfView.backgroundColor=[UIColor clearColor];
doneButton = [[UIBarButtonItem alloc]initWithTitle:@" Done " style:UIBarButtonItemStyleBordered target:self action:@selector(doneButtonClick)];
self.navigationItem.leftBarButtonItem =doneButton;
webView.backgroundColor=[UIColor clearColor];
NSLog(@"File Name is %@",fileName);
NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:@"png"];
NSURL *url = [NSURL fileURLWithPath:fileName];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView setScalesPageToFit:YES];
[webView loadRequest:request];
有没有什么办法来加载这个图像,其是在这个webView的服务器来自fileName谢谢
你的路径是我认为不正确。你从服务器获取图像的真正路径是什么? –
http://celeritas-solutions.com/pah_brd_v1/productivo/pro/imageName.png这是服务器获取图像的路径 –
检查了这一点http://iphonedevsdk.com/forum/iphone-sdk-development/1937- uiwebview-displays-image-from-resource-file.html – iCoder