[UIImage imageNamed: @ "tab_back"] solves the problem of not displaying images,
[UIImage imageNamed: @”tab_back1_images does not show images, while the image tab_back.png exists in the project.
I. Reasons
This is probably because folder references instead of virtual groups are selected when you add images to the project. For example:
2. What do the two methods mean?
1. Create groups: add the selected file to the group of the project. If you select a folder, the folder is considered a group. The added group and file paths do not necessarily correspond one to one. They are a virtual management directory. The generated folder is yellow.
2. Create folder references: Create a folder index and add all files in the folder to the project. The project directory and file path corresponding to the folder he added correspond one to one. If you want to delete a file, you can directly delete the file under the file directory, and then refresh the directory to delete the file. The generated folder is blue.
Iii. Resources and compilation
After "Create groups" is selected, these image resources will be compiled into the app, for example:
Copy Bundle Resources refers to the resource files that will be included in the. app of the generated product.
The added image resources can be referenced in the app!
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.