【问题标题】:Why phonegap application always shows own default page after override index.html为什么 phonegap 应用程序在覆盖 index.html 后总是显示自己的默认页面
【发布时间】:2014-11-08 18:37:08
【问题描述】:

您好,我在 PhoneGap 中制作了一个 hello world 类型的应用程序。我在www 目录中有 index.html,但它显示的是 phonegap 的默认主页。请查看它始终显示的附加屏幕截图。

index.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" />
        <title>Hello World</title>
    </head>
    <body>
        <script type="text/javascript" src="cordova.js"></script>
        <script type="text/javascript" src="js/index.js"></script>
        <script type="text/javascript">
            app.initialize();
        </script>

        <form>
            Select your favourite color: <input type="color" name="favcolor">
            <br/>
            <input type="button" value="SUBMIT" />
        </form>

    </body>
</html>

但是当我在安卓手机上运行应用程序时,它总是显示这个。我已经完成了 3-4 次重建完整的项目,但还是一样。

我不确定出了什么问题或遗漏了什么。

提前致谢。

【问题讨论】:

  • 在你添加的平台构建之前,尝试手动更改 www 文件夹的内容,然后进行构建,看看它是否有效。
  • @ashfaq.p 是的,我也在问题中更改并上传了代码。

标签: android html cordova


【解决方案1】:

我认为您正在对添加的平台内的 www 文件夹进行更改。 尝试在项目根文件夹中的 www 文件夹中进行更改,然后进行构建,它肯定会起作用。 检查这个:

【讨论】:

  • 看这个dropbox.com/s/f00yh7up7uygbpb/8.png?dl=0我在这个index.html中编辑
  • 但是你的代码在我的模拟器和我的安卓设备上运行良好。您可以将完整的演示文件夹上传到保管箱吗?
  • 我看到那里也有平台文件夹,然后是 android 然后是 platform_www .. 我必须在那里添加吗?
  • 不,不要更改平台内的任何内容。当您使用您在根 www 文件夹中所做的所有更改进行构建时,它会自动更新。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-04-01
  • 1970-01-01
  • 2011-07-05
  • 2020-04-05
  • 2021-11-25
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多