ios - 使用 Cordova ios 构建时未显示图像

标签 ios cordova

我的图像没有显示在我的移动 Cordova 版本中,我将不胜感激。在 Phonegap 中需要放置 images in the root . Cordova 也是这样吗?

我的结构如下:

/www
   index.html
       /assets
           /img

我从我的 index.html 文件中调用这样的图像:
<img src="assets/img/myfile.png" />

图像无法加载是否有原因?我检查了文件权限。我的猜测是我需要更改我的 config.xml。这些“允许/访问”规则是否足够?
  <allow-navigation href="file://*/*"/>
  <allow-navigation href="*"/>
  <allow-intent href="file://*/*"/>
  <allow-intent href="*"/>
  <access origin="file://*/*"/>
  <access origin="*"/>

最佳答案

如果您使用的是 Visual Studio,请不要忘记将图像添加到解决方案中,而不仅仅是将它们放入正确的文件夹中。如果它们不是解决方案的一部分,则它们不能在艺术 Assets 编译期间捆绑,因此不会出现在部署中。

关于ios - 使用 Cordova ios 构建时未显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35531687/

相关文章:

ios - 检测在手势识别器对象区域之外开始的滑动

ios - 无法使用 swift 4.1 创建自定义框架

android - HTML 代码 index.html 设计不适合 Phonegap android 应用程序的移动 View ?

ajax - 在phonegap错误中通过ajax调用SOAP Web服务

ios - Phonegap/Cordova 中 iphone 数字键盘上的小数点

ios - UIScrollView滚动ViewWillEndDragging : targetContentOffset: not working

ios - 使用 RSBarcodes 扫描条形码时执行操作

iOS 应用内购买非续订订阅收据验证

cordova - 防止在适用于 Windows Phone 8 的 Cordova 中滚动出 CordovaView

cordova - ionic 侧边菜单和原生谷歌地图