當我加載嵌入了SWF的外部HTML時,它在UIWebView中工作。
當我嘗試添加在Xcode中的所有文件,並加載出現UIWebView的地方,沒有什麼,但我知道它試圖加載...
-The代碼:帶有swf加載外部鏈接的UIWebView html文件,但內部爲
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...");
}
-and這裏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>
不知道它是否與蘋果不接受SWF的事實有關。但是,如果不是,爲什麼要在外面進行?你同意嗎?
不缺少添加文件。 JS或其他,因爲我在這裏找到一個工作人員加載時遇到問題。 JS被閱讀和使用,但沒有找到SWF。
謝謝。
你能解釋一下你的解決方案嗎? – Petr 2013-01-10 08:01:31
我使用了上面提到的插件。然後他將iPhone或iPad變成一個「web服務」,即Javascript,它編譯SWF以運行HTML工作。否則,iOS不會。 進行一個簡單的測試,進入一個由瀏覽器在您的設備上編譯FLASH的網站,嘗試在HTML中編寫相同的代碼並嘗試在iOS上運行,這將無法工作。當使用插件在iOS中使用「webservice」時,代碼通常可以工作。 是我最好的解釋嗎?或不? – 2013-01-10 13:44:12
謝謝。我理解你的解釋。 – Petr 2013-01-10 14:10:05