1. First make sure that the name of the picture is ***@1x.png, ***@2x.png or ***@3x.png
| Iphone--iphone3gs |
@1x.png |
| Iphone--iphone6 |
@2x.png |
| IPhone 6 Plus and above |
@3x.png |
2. Copy the image to the following directory
<cordova_project_root>/platforms/ios/<project_name>/Resources
If the resources folder does not exist, please create it yourself.
3. Copy the image to the resources folder of Xcode
Done!!! Can be used normally in the project.
To import image resources for IOS, it was slightly trickier, because you had to register your file in Xcode project file W ith help from Xcode, and there is both ways of doing this. Let's start with the old school. IOS also shares similar concept with Android in terms of pixel density. iphone to iphone 3GS uses 1x the resolution, iphone 4 to iphone 6 uses 2x the resolution when iphone 6 Plus and above use S 3x the resolution (even though it's actually down scaled, but that ' s a different discussion). In the old school-on-the-your-images with @1x , @2x and @3x suffix with respect to their target densi Ty. eg. [email protected]. Here's a documentation that explains this concept. You'll have the to move it under
<cordova_project_root>/platforms/ios/<project_name>/Resources
Then open your native IOS project with Xcode in double clicking on
<cordova_project_root>/platforms/ios/<project_name>.xcodeproj
In the left hand side panel, make sure is in Project Navigator tab. Then you can see a list of directories under your project. One of them being Resources , but you don't see your newly added images there. Now, need to drag your images fron Finder to Xcode and drop it under Resource folder. In your JavaScript config, can and reference to them without suffix or extension. eg. With the previous example, simply'll icon suffice.
Themeablebrowser The use of button pictures in iOS