0
我正在研究iPhone/iPad应用程序。尝试在应用程序的本地目录中存储的UIImage视图中加载非常大的图像。代码:无法在用户界面Webview中加载大图像ios
NSString *path = [[NSBundle mainBundle] pathForResource:selectedImage ofType:@"jpg"];
NSString *cssString = @"<style type='text/css'>img {width: 100%; height: auto;} body { margin: 0; padding: 0; }</style>";
NSString *htmlString = [NSString stringWithFormat:@"<html><head>%@</head><body><img src=\"file://%@\" /></body></html>",cssString,path];
[webview loadHTMLString:htmlString baseURL:nil];
在iPhone和模拟器图像被完全加载,但是当我尝试在iPod的触摸4G运行程序的时候,错过在UI网页视图图像。我想有一些内存问题。不确定。 任何帮助。
影像尺寸为:640 * 5000
确保图像的名字与您在项目包中添加的相同bcz Simulator不区分大小写。 – 2013-04-08 12:07:50
这不是问题。 Iphone 4完美加载。问题只与iPod有关 – 2013-04-08 12:43:42