SWF が埋め込まれた外部 HTML を読み込むと、UIWebView で動作します。
すべてのファイルを Xcode に追加して、UIWebView をローカルにロードしようとすると、何も表示されませんが、ロードしようとしたことはわかっています...
-コード:
NSString *filePath =
[[NSBundle mainBundle] pathForResource:@"vimmar" ofType:@"html"];
NSData *htmlData = [NSData dataWithContentsOfFile:filePath];
if (htmlData)
{
NSBundle *bundle = [NSBundle mainBundle];
NSString *path = [bundle bundlePath];
NSString *fullPath = [NSBundle pathForResource:@"vimmar"
ofType:@"html" inDirectory:path];
[pagina_web_local loadRequest:[NSURLRequest requestWithURL:
[NSURL fileURLWithPath:fullPath]]];
}
else
{
NSLog(@"No data for you...");
}
-そしてここに HTML
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Default</title>
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<style type="text/css">
@media only screen and (min-device-width: 800px) { html { overflow:hidden; } }
* { padding: 0; margin: 0; }
html { height: 100%; }
body { height: 100%; overflow:hidden; }
#container { height: 100%; min-height: 100%; width: 100%; margin: 0 auto; }
</style>
</head>
<body>
<script src="swfobject/swfkrpano.js"></script>
<div id="container">
<div id="panoDIV" style="height:100%;">
<script>
embedpano({target:"panoDIV",swf:"vimmar.swf"});
</script>
<noscript>
<div id="tour">
<object width="100%" height="100%">
<embed src="vimmar.swf" width="100%" height="100%" allowFullScreen="true"></embed>
</object>
</div>
</noscript>
</div>
</div>
</body>
</html>
Apple が SWF を受け入れないという事実と関係があるかどうかはわかりません。しかし、そうでなければ、なぜ外に運ばれるのでしょうか? 同意しますか?
ファイルの追加が不足しているわけではありません。JS またはその他、ここで読み込みに問題のあるスタッフを見つけました。JS は読んで役に立ちましたが、SWF は見つかりませんでした。
ありがとうございました。