Themeablebrowser the use of button images in iOS

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.