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