iPhone: UIImage imageNamed doesn't show the image

前端 未结 5 552
自闭症患者
自闭症患者 2020-12-20 02:25

\"enter

Hi,

I am trying to use the attached image in an UITableView cell. Imag

相关标签:
5条回答
  • 2020-12-20 02:59

    I had that kind of problem lots of time. 90% times it was distraction errors :) There are lots of possible reasons. Here's are the ones I've seen :

    • You forgot to include the image to bundle
    • Your image is corrupted
    • You are using photoshop and you saved your image to PSD with a png extension (mac OS show preview of PSD files).
    • You forgot to add your view to a superview (arrives sooo often)
    • Wrong file name (imageName.png instead of imagename.png)
    • (from Ankit Srivastava) no memory allocated to imageview
    • ... if I remember some other i'd edit the post.

    Hope this helps

    0 讨论(0)
  • 2020-12-20 03:05

    Check also for duplicate names in bundles AND in your developing folder. (where all the code stuff is saved)

    0 讨论(0)
  • 2020-12-20 03:08

    I think you have not copied exactly the images in your application bundle that is being not displayed in the cell.

    Try & check removing bunch of images and add those again in your project.

    0 讨论(0)
  • 2020-12-20 03:09

    If you click on the image in the left-hand Project Navigator window, then select File Inspector on the right-hand Utilities window, make sure the checkbox is checked for the correct target in the Target Membership region.

    0 讨论(0)
  • 2020-12-20 03:20

    File names are case-sensitive when used in iDevices (iPhone/iPod Touch/iPad) and in Simulator too.

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