Image on UIbutton visible on simulator but lost on device
I have made an application which incl开发者_C百科udes movie player in it. Video starts playing on touching PLAY button. I have set an image "Play.png" on button and while running on simulator Image shows up but on device image does not show up.. Well I checked application on iOS 4.3 simulator and installed it on device iOS 3.2. Is it because of older version ? Thanks..
I don't think OS version matters. Just check the case of your image name and the one you are using.
Once it happened to me because of wrong case of the image name. My image name was "portraitbackground.png" and I was writing "PortraitBackground.png". Remember the simulator is running on mac os not iOS. Anyway, just check the case and write exactly what the image name is. I think .png and .PNG would also be treated as different but I haven't experienced it.
I meet an issue like this problem but a little different. My Xcode version is 9.3. I import a third foundation in my project. In the foundation, all images are in bundle. In order to adapt my UI,I replace some pictures in the bundle,that use the same name.
But in recent days ,the foundation is update. on the last version , images name used capital letters。And On the newest version ,images name used lowercase。After update,replace images and rename images,I find that the images that renamed visible on simulator but lost on device.
After keep trying, i found that the problem was Xcode's bug. Because I rename images in Xcode just like 1.
How I rename images is in Xcode
So I rename images in finder and Shift + Command + K.
精彩评论