我正在尝试为 iOS 应用程序实现 360° 旋转。我的目标是在 HTML 上完成并在 UIWebView 中加载它。
我试过的:
我使用JQuery Reel 插件进行 360° 旋转。
我的HTML 代码如下所示:
<script src="JQuery.js" type="text/javascript"></script>
<script src="reel.js" type="text/javascript"></script>
<img src="images/360_1.jpg" width="480" height="360"
class="reel"
data-images="images/360_#.jpg|1..36"
data-frames="10"
data-footage="2"
data-revolution="800">
结果 :
这适用于 Windows(Firefox、Chrome 和 IE)和 Mac OS(Safari)。但在 iOSUIWebView
中它只显示初始图像而不是旋转。
iOS 代码:
在 iOS 中,我将整个文件添加到我的项目中并加载如下页面:
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]];
[self.webview loadRequest:[NSURLRequest requestWithURL:url]];
也试过:
NSString *path = [[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"];
NSString *html = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
[self.webviewloadHTMLString:html baseURL:[[NSBundle mainBundle] bundleURL]];
但是没有解决我的问题,请帮助我。