Images showing in simulator but not on the iPhone device

前端 未结 5 1236
别跟我提以往
别跟我提以往 2021-01-02 12:00

So when I run the application from the device the pictures show up and everything works great. However, when I move to the device I run in about 10 out of 38 pictures that d

相关标签:
5条回答
  • 2021-01-02 12:15

    Apparently the iPhone caches the launch screens. So in my case, I had to reboot my iPhone before being able to see the image.

    0 讨论(0)
  • 2021-01-02 12:21

    First thing to check is the case of the strings you're using to refer to the resources. The iPhone is case sensitive, but the simulator is not.

    Oops, just seen that you checked the case. Better log all your UIImage creation calls then!

    0 讨论(0)
  • 2021-01-02 12:26

    The simulator accepts a wider range of image formats. Sometimes you had a specific file type that the device cannot display. Double check the 10 files looking for some difference from the others ones.

    0 讨论(0)
  • 2021-01-02 12:32

    Yes, memory absolutely plays into this. Check your UIImage creation calls and make sure they dont return empty. Also, check to see if youre getting memory warnings in the console window.

    0 讨论(0)
  • 2021-01-02 12:33

    Generally, if in-memory size was the culprit, your application would crash with a low memory error on the device. However, it seems like the images just don't display.

    One other thing that can be going wrong is the size of the images. UIViews on the iPhone can only have dimensions smaller than the maximum texture size supported by the GPU. Apple states that this is 1024 x 1024, but I've found it to be more like 2048 x 2048 on even the original model iPhone. You may be creating a view for some of these images that exceeds this size in one dimension, but your Mac has a larger maximum texture size on its GPU and so it displays fine in the Simulator.

    0 讨论(0)
提交回复
热议问题