简体   繁体   English

图片已加载到模拟器中但未加载到设备上?

[英]Images loaded in simulator but not on device?

I developed an application with Sencha Touch, which runs fine in iOS Simulator. 我使用Sencha Touch开发了一个应用程序,该应用程序可以在iOS Simulator中正常运行。 The background image of my document body is shown. 显示了我的文档正文的背景图像。

When deploying the app to my iPhone, the background image is not shown anymore. 将应用程序部署到我的iPhone时,背景图像不再显示。 I know, there are problems with case-sensitivity, which differs from simulator to device. 我知道,区分大小写存在一些问题,具体情况因模拟器而异。 I checked my filenames and everything is in lower case. 我检查了文件名,所有内容均以小写字母表示。

Here is my CSS code (in ./css/app.css): 这是我的CSS代码(位于./css/app.css中):

.x-main {
  background-image: url('../images/swoosh.jpg');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
}

The swoosh.jpg exists in the image folder, which is beside css folder. swoosh.jpg存在于css文件夹旁边的图像文件夹中。

What do I wrong? 我怎么了 It's just not working on device, in iOS Simulator, everything is fine. 它只是在设备上不起作用,在iOS Simulator中,一切都很好。

Thanks in advance! 提前致谢!

UPDATE: 更新:

Found the problem for myself: I have to specify the path as url('/public/images/swoosh.jpg') 为我自己发现了问题:我必须将路径指定为url('/public/images/swoosh.jpg')

Now it works! 现在可以了!

make sure you are using the exact same name means case sensitivity. 确保使用完全相同的名称表示区分大小写。 Simulator is case insensitive while Device is case sensitive. 模拟器不区分大小写,而设备区分大小写。 MyImage.jpg and myimage.jpg are two different image in device. MyImage.jpg和myimage.jpg是设备中的两个不同图像。

Had the same problem. 有同样的问题。

In my case the problem was calling server files thru http:// 就我而言,问题是通过http://调用服务器文件

I fixed all the problems by changing all links to https:// 我通过将所有链接更改为https://修复了所有问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM