当我加载嵌入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>
不知道这是否与苹果不接受SWF的事实有关。但如果不是,为什么要被带到外面?你同意吗?
不是因为缺少添加文件。JS或其他,因为我在这里发现工作人员加载时遇到问题。JS被阅读并很有用,但没有找到SWF。
谢谢。
我怀疑苹果不会构建JavaScript
并以HTML格式处理嵌入的SWF
文件。
所以我寻找一种方法在 iOS 中创建webservice
来编译和运行这里需要SWF
(https://github.com/robbiehanson/CocoaHTTPServer/)。
SWF文件不是纯的,它编译并转换为HTML可接受的格式。XCode
本身没有的东西。所以,我得到了我们需要的结果。
如果你有人需要,这就是解决方案,创建一个迷你网络服务来编译javascript和其他服务器要处理的东西,并以HTML格式显示最终结果。
我很难理解你的问题 - 但 Flash 在 UIWebView 中不起作用。如果您在 Safari 中浏览特定网站,并且它似乎正在工作,则该网站可能正在提供 HTML5 版本。
iOS 严格不支持任何包含 swf 的 Flash 项目。
原因:1)闪光灯耗尽电池电量,即必须对SWF进行解码 解码应在硬件级别而不是软件级别 5o % 百分比的闪存项目(不是最新)导致使用软件级解码
2)导致安全漏洞甚至 mcaFee 也声称上述一项至关重要
3)应用程序崩溃:闪存是Mac中应用程序崩溃的首要原因
4)易于开发:Mac不希望他们的开发人员将注意力转移到第三方项目上,第三方不会针对特定平台进行定制,最终将是跨平台的。
5)财务原因:允许在ios上使用Flash将与App Store竞争。
所以由于上述原因,iOS Don支持闪存
如果你想为任何图表闪光,你可以通过下面的链接
http://blog.fusioncharts.com/2012/02/create-charts-for-iphone-and-ipad-apps-using-fusioncharts-xt/http://docs.fusioncharts.com/charts/contents/FirstChart/UsingPureJS.htmlhttp://docs.fusioncharts.com/charts/contents/index.html?FirstChart/UsingPureJS.html