ThemeableBrowser在IOS中按鈕圖片的使用

來源:互聯網
上載者:User

標籤:conf   library   html   table   har   ane   pix   order   view   

 

 

1. 首先確保圖片的名稱為 ***@1x.png, ***@2x.png 或 ***@3x.png

iPhone —— iPhone3GS ***@1x.png
iPhone —— iPhone6 ***@2x.png
iPhone 6 Plus and above ***@3x.png

2. 複製圖片到以下目錄

<cordova_project_root>/platforms/ios/<project_name>/Resources
Resources檔案夾不存在的話,請自行建立。

3. 複製圖片到XCode的Resources檔案夾下

大功告成!!!下來就可以在項目中正常使用了

 

 

To import image resources for iOS, it is slightly trickier, because you have to register your file in Xcode project file with help from Xcode, and there are two ways of doing this. Let‘s start with the old school way. 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 while iPhone 6 Plus and above uses 3x the resolution (even though it‘s actually down scaled, but that‘s a different discussion). In the old school way, you have to name your images with @1x@2x, and @3x suffix with respect to their target density. eg. [email protected]. Here is a documentation that explains this concept. You then have to move it under

<cordova_project_root>/platforms/ios/<project_name>/Resources

Then open your native iOS project with Xcode by double clicking on

<cordova_project_root>/platforms/ios/<project_name>.xcodeproj

In the left hand side panel, make sure you are 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 you need to drag your images fron Finder to Xcode and drop it under Resource folder. In your JavaScript config, you can then reference to them without suffix or extension. eg. With the previous example, simply icon will suffice.

               

               

ThemeableBrowser在IOS中按鈕圖片的使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.