私はiPhone / iPadアプリケーションに取り組んでいます。アプリのローカル ディレクトリに保存されている UIImage ビューに非常に大きな画像を読み込もうとしています。コード:
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 と Simulator ではイメージが完全に読み込まれますが、iPod touch 4g でアプリを実行しようとすると、UI Webview でイメージが表示されません。メモリの問題もあると思います。わからない。どんな助けでも。
画像サイズ: 640*5000