我试图通过使用聚合物(0.5)制作的phonegap(3.7)(build.phonegap.com)构建示例应用程序。构建成功。但是,当我在我的android(v4.4 +)设备上安装应用程序时,我看不到聚合物元素(我刚刚插入了一个<paper-checkbox>
进行测试)。所有其他简单的HTML元素都正常渲染。聚合物:无法查看Android设备中的聚合物元素
我读了关于HTML导入的android webview支持,所以我试图硫化index.html,但它没有帮助。但我可以通过在笔记本电脑上运行python SimpleHTTPServer来查看聚合物元素,并且在浏览器javascript控制台中没有错误(failed to load resource.. cordova.js
除外)。
这里的的index.html(非硫化版)我已经创建:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<link rel="import" href="res/bower_components/paper-checkbox/paper-checkbox.html">
<script type="text/javascript" src="res/bower_components/webcomponentsjs/webcomponents.js"></script>
<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="js/index.js"></script>
</head>
<body>
<div class="app">
<h1>PhoneGap</h1>
<div id="deviceready" class="blink">
<h3>POLYMER!</h3>
</div>
<br>
<p>Introducing Polymer element next...</p>
<hr>
<paper-checkbox></paper-checkbox> This is a polymer checkbox
<hr>
</div>
<script type="text/javascript">
app.initialize();
</script>
</body>
下面是该项目
- config.xml中 的目录结构
- 挂钩
- platf奥姆斯
- 插件
- WWW
- config.xml中
- CSS
- 的icon.png
- IMG
- 的index.html
- JS
- index.js
- RES
- bower_components
- 聚合物
- webcomponentsjs
- 图标
- 屏幕
- bower_components
- 规格
- spec.html
有什么我失踪?请帮忙。谢谢!
问候, Soumya
我尝试了聚合物作为来自我的朋友[Oswald Campesato]的请求(http://www.amazon.com/gp/search/ref=a9_sc_1?keywords=oswald+campesato)。它不起作用。他是[硅谷的Web组件聚会]组织成员之一(http://www.meetup.com/Web-Components-Silicon-Valley-Meetup/)。你可能可以向他们寻求帮助。 – JesseMonroy650
谢谢JesseMonroy650,我会尽力达到他们。 –
我相信是因为使用旧浏览器的设备上的聚合物不兼容。 Android使用其原有的浏览器来显示我们的phonegap项目。不幸的是它不支持像dom API这样的最新技术。 – NarayaN