1

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 は見つかりませんでした。

ありがとうございました。

4

3 に答える 3

3

Apple はHTMLJavaScriptに埋め込まれたファイルをビルドして処理しないのではないかと思います。SWF

webserviceそこで、iOS でを作成してここで必要なコンパイルと実行を行う方法を探しましたSWF( https://github.com/robbiehanson/CocoaHTTPServer/ )。
SWF ファイルは純粋ではなく、HTML で受け入れ可能な形式にコンパイルおよび変換されます。XCode本来ないもの。それで、必要な結果が得られました。

誰かが必要とする場合、これが解決策であり、サーバーが処理して HTML で最終結果を表示する javascript やその他のものをコンパイルするためのミニ Web サービスを作成します。

于 2012-08-13T22:34:08.010 に答える
1

あなたの質問を理解するのに苦労していますが、Flash はUIWebView では動作しません。Safari で特定の Web サイトを閲覧し、動作しているように見える場合、その Web サイトは HTML5 バージョンを提供している可能性があります。

于 2012-08-13T21:54:28.650 に答える