iphone 4 - 应用程序不显示图像?
在 iphone 4 推出之前,我一直在应用程序商店中使用这个应用程序,没有出现任何问题。 我的主页有一张覆盖整个屏幕的图像。
界面构建器中添加了 UIImageView,界面构建器中添加了图像路径。
在所有手机中都会显示此图像;但是,该图像不会在任何 iphone 4 中显示,而是用户看到如下所示的空白屏幕: 有人知道是什么原因造成的吗?谢谢
。
我只有 1 组图像 正常分辨率
此问题仅发生在其中之一 我的应用程序中的图像是 我的主页背景
图形文件不应该是 已损坏,因为完全相同 图像适用于所有其他 iPhone 和 触摸
我的图像是 jpg 文件
图像大小是 480x270,其中 界面生成器我将其设置为 563x330 以仅显示其中的一部分
我没有此 uiimageview 的出口 所以不能在代码中更改
I've had this app on app store with no problem until iphone 4 came out.
My home page has an image covering the whole screen.
UIImageView added in interface builder, and image path added in interface builder.
In all phones this image shows up; however, the image does not show up in any iphone 4, and instead the user sees a blank screen like the following:
Anybody knows what's causing this? thanks
.
I only have 1 set of images with
normal resolutionThis problem only happens to one of
the images in my application which is
the background for my home pagethe graphic file should not be
corrupted because the exact same
image works for all other iphones and
itouchesmy image is a jpg file
image size is 480x270, which in
interface builder i make it 563x330 to display only a part of itI have no outlet to this uiimageview
so it cannot be changed in code
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果这是我的代码,我会编写一个小应用程序来显示有问题的图像。如果仍然失败,那么获得调试问题的帮助会更容易。
If this was my code, I'd write a tiny app just to display the image in question. If it still fails it would be easier to get help debugging the problem.
对于配备新视网膜显示屏的设备,像素大小会有所不同,您必须特别检查以下内容:
myimage.png
和[电子邮件受保护]
)很难判断这是这些要点中的任何一个还是其他什么,因为你提供的细节太少了,所以我坚持通用的东西。如果您需要更多帮助,请在下面发表评论(或编辑您的问题)。
With devices with the new retina display, pixel sizes are different and you have to check for the following, in particular:
myimage.png
and[email protected]
)It's hard to tell if it's any of these points, or something else, because you provide so damn little detail, that I stick to generic things. Comment below (or edit your question) if you need more help.
我有两件事要添加到
FX
的完整答案中:考虑到您添加的信息,我会看一下您用于设置 UIImageView 的代码。也许您使用了某种检测代码或未正确实现的东西。
您介意分享一些代码片段吗?
根据 Apple 的文档,从 iOS 4 开始,您不需要提供“.png”扩展名。也许这就是导致问题的原因。
同样,代码片段在这里会有帮助。特别是在处理加载图像文件的位置。
编辑:
尝试重新保存图像并替换它。我偶尔会损坏 Photoshop 中的文件。这与文件扩展名以及 Mac OS 如何忽略它们有关,但 Photoshop 仍然使用它们。
此外,它可能与图像在 XCode 项目中的位置有关。检查它所在的组。确保一切就位,然后清理并重建。从 iPhone4 中删除该应用程序(重新启动)并尝试重新安装。
我希望这有帮助。
祝你好运!
I've got two things to add to
FX
s thorough answer:Considering the information you added, I would take a look at your code for setting up that UIImageView. Perhaps you use some sort of detection code or something which wasn't implemented correctly.
Would you mind sharing some code snippets?
According to Apple's documentation, you don't need to provide the ".png" extension as of iOS 4. Perhaps that is causing the problem.
Again, code snippets would help here. Specifically where you deal with loading up your image file.
EDIT:
Try re-saving the image and replacing it. I've occasionally corrupted files in Photoshop. This has to do with file extensions and how Mac OS ignores them, but Photoshop still uses them.
Also, it could have to do with where the image is in your XCode project. Check what Group it is in. Make sure everything is in place and then Clean and Rebuild. Remove the app from the iPhone4 (reboot) and try reinstalling.
I hope this helps.
Good luck!