I have a UIImageView
in storyboard. I have placed a .png
image in .xcassests
folder. I have correctly assigned the image name to the UIImageView
which correctly shows in Xcode
Storyboard. However when I run it on device/simulator, there is no image displayed. When I create the UIImageView
in code then the image is displayed. My project code is in Objective-C
I have tried the following already
.xcassets
and reassignedHowever none of the above has worked for me so far. Any suggestions are highly appreciated.
Well, it should work from what you implemented see. Xcode gets weird sometimes when it comes to referencing resources. I recommend removing the images, clean and build if possible remove the view controller and add again. See if it works.
Seems like there is no issue with the implementation part. Try adding clips to bounds to imageView
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.