`

How are the icon files in my application bundle used on iPad and iPhone?

阅读更多

http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html

<!-- BEGIN LOGO AND SEARCH --><!-- END LOGO AND SEARCH --><!-- START MAIN CONTENT --><!-- START TITLE GRAPHIC AND INTRO -->

Technical Q&A QA1686
App Icons on iPad and iPhone

<!-- END TITLE GRAPHIC AND INTRO --><!-- BEGIN WIDE COLUMN -->
<!-- BEGIN CONTENTS -->

Q: How are the icon files in my application bundle used on iPad and iPhone?

A: Below are guidelines for handling icon files for iPhone-only apps, iPad-only apps, and universal apps.

IMPORTANT: Icons marked with "Required" must be supplied in your application bundle.

iPhone-only Apps

Include the following in your application's Resources group in the Xcode project:

Table 1 : iPhone-only apps icon requirements.

Image Size (px) File Name Used For Required Status Notes
512x512 iTunesArtwork Ad Hoc iTunes Optional but recommended File should be in png format, but name it without the .png extension
57x57 Icon.png App Store and Home screen on iPhone/iPod touch Required <None>
114x114 Icon@2x.png Home screen for iPhone 4 High Resolution Optional but recommended <None>
72x72 Icon-72.png Home screen for iPad compatibility Optional but recommended <None>
29x29 Icon-Small.png Spotlight and Settings Optional but recommended <None>
50x50 Icon-Small-50.png Spotlight for iPad compatibility Recommended if you have a Settings bundle, otherwise optional but recommended <None>
58x58 Icon-Small@2x.png Spotlight and Settings for iPhone 4 High Resolution Recommended if you have a Settings bundle, otherwise optional but recommended <None>

Your Resources group should look similar to Figure 1:

Figure 1: Add files to Resources group

Figure 1, Add files to Resources group

Except for iTunesArtWork icon, list the names of each of these files in the Icon files entry in the Info.plist, in the order shown in the table. Follow the steps in "Add Icon files in Info.plist" section below. See Figure 4.

Back to Top

iPad-only Apps

Include the following in your application's Resources group in the Xcode project:

Table 2 : iPad-only apps icon requirements.

Image Size (px) File Name Used For Required Status Notes
512x512 iTunesArtwork Ad Hoc iTunes Optional but recommended File should be in png format, but name it without the .png extension
72x72 Icon-72.png App Store and Home screen on iPad Required <None>
50x50 Icon-Small-50.png Spotlight on iPad Optional but recommended <None>
29x29 Icon-Small.png Settings on iPad Recommended if you have a Settings bundle, otherwise optional but recommended <None>

Except for iTunesArtWork icon, list the names of each of these files in the Icon files entry in the Info.plist, in the order shown in the table. Follow the steps in "Add Icon files in Info.plist" section below. See Figure 5.

Back to Top

Universal Apps

Include the following in your application's Resources group in the Xcode project:

Table 3 : Universal apps icon requirements.

Image Size (px) File Name Used For Required Status Notes
512x512 iTunesArtwork Ad Hoc iTunes Optional but recommended File should be in png format, but name it without the .png extension
57x57 Icon.png App Store and the Home screen on iPhone/iPod touch Required <None>
114x114 Icon@2x.png Home screen for iPhone 4 High Resolution Optional but recommended <None>
72x72 Icon-72.png App Store and Home screen on iPad Required <None>
29x29 Icon-Small.png Settings on iPad and iPhone, and Spotlight on iPhone Recommended if you have a Settings bundle, otherwise optional but recommended <None>
50x50 Icon-Small-50.png Spotlight on iPad Optional but recommended <None>
58x58 Icon-Small@2x.png Spotlight and Settings for iPhone 4 High Resolution Recommended if you have a Settings bundle, otherwise optional but recommended <None>

Except for iTunesArtWork icon, list the names of each of these files in the Icon files entry in the Info.plist, in the order shown in the table. Follow the steps in "Add Icon files in Info.plist" section below. See Figure 4.

Back to Top

Add Icon files in Info.plist

To add the Icon files entry you will need to manually edit your Info.plist.

Open your Info.plist in Xcode, and locate the "Icon file" entry. Click on the plus (+) button at the end of the entry to make a new key entry. as shown in Figure 2.

Figure 2: Add a new entry under "Icon file" key

Figure 2, Add a new entry under "Icon file" key

Then, type "Icon files" in the key column (notice the "s" added), or choose "Icon files" from the drop down list, as shown in Figure 3.

Figure 3: Add "Icon files" key in Info.plist

Figure 3, Add "Icon files" key in Info.plist

Next, turn down the disclosure triangle on "Icon files" and add the entries for the icons for your application, as shown in Figure 4 and Figure 5:

Figure 4: Add icon file entries for iPhone-only or Universal apps.

Figure 4, Add icon file entries for iPhone-only or Universal apps.

Figure 5: Add entries for iPad icon files.

Figure 5, Add entries for iPad icon files.

Note: If you don't provide one of the listed optional icons, the system will automatically scale one of your existing icons to an appropriate size. However, it is strongly recommended that your application supply all the icons listed with specific sizes needed.

///////////////////////////////////////////

http://www.cocoachina.com/bbs/read.php?tid-24549.html

以前貌似发现相关尺寸,这次来点详细的,相信不少人用的到。。。。

从icon说起
命名方法,举例
Icon.png 57×57
Icon-72.png 72×72
Icon-Small.png 29×29
Icon-Small-50.png 50×50
Icon@2x.png114×114
Icon-Small@2x.png 58×58


iTunesArtwork 512×512

在info.plist使用key CFBundleIconFiles,注意与CFBundleIconFile区分开,CFBundleIconFiles的优先级高于CFBundleIconFile
省略扩展名,直接写Icon,会自动识别
如果要加扩展名,必须把所有的图片名都添加到CFBundleIconFiles的array中
特别需要注意的是,如果想自动识别,命名必须严格按照标准,且key为string类型。如果不自动识别,key为array类似并将完整文件名添加进去


Default命名方法

<basename><orientation_modifier><scale_modifier><device_modifier>.png

这个就不多说了,方法和icon是一样的,只列出相关的后缀

<basename>默认为Default,也可用UILaunchImageFile key设置,在这用Default举例
<orientation_modifier> 旋转方向

-PortraitUpsideDown
-LandscapeLeft
-LandscapeRight
-Portrait
-Landscape
None

也就是说你可以Default-Portrait.png 来表示竖屏时的加载图像,同样也可以直接Default.png不指定方向

<scale_modifier>依然是为iphone4准备,用法和icon雷同
Default-Portrait.png与Default-Portrait@2x.png会自动识别

<device_modifier>区分设备,有2个值
~iphone
~ipad
Default-Portrait~iphone.png与Default-Portrait~ipad.png会自动判断设备同样需要注意的一点,这个在icon里面同样适应,但是貌似现在没有使用的必要,看来未来ipad的分辨率也会扩充一倍?


如果使用了Custom URL Schemes,不多说了,格式如下,用法同上
<basename>-<url_scheme><scale_modifier><device_modifier>.png
如:
Default-myscheme.png与Default-myscheme@2x.png

图片:
如果你的资源目录下有Button.png与Button@2x.png两张图片
那么使用:
UIImage* anImage = [UIImage imageNamed:@"Button"];
将会自动识别图片加载

////////////////////////////////////////////

Add a CFBundleIconFiles key of type Array to your Info.plist. The array should contain 2 string items: the filenames of the two icons. The OS will then automatically choose the correct icon for each platform based on their pixel dimensions.

You can keep the CFBundleIconFile key and have it point to the icon file for the iPhone for 3.0/3.1 compatibility.

Update May 2010: Apple now has Technical Note explaining this in great detail: Technical Q&A QA1686 – App Icons on iPad and iPhone

分享到:
评论

相关推荐

    android sdk 自带 实例(samples)

    An application that demonstrates how to create a live wallpaper and bundle it in an application that users can install on their devices. Lunar Lander A classic Lunar Lander game. Multiple ...

    iOS Application Programming Guide

    iOS应用程序编程指南 英文版 Contents Introduction About iOS Application Design 9 Understanding the iOS Runtime Environment 10 ...Creating and Modifying the Settings Bundle 78 4 2011-02-

    Isomorphic+JavaScript+Web+Development-Packt+Publishing(2017).pdf

    Chapter 1, Getting Started with Isomorphic Web Apps, describes what isomorphic apps are and how they differ from the conventional SPAs that are around. They will understand the main challenges that ...

    Rational Data and Application Modeling Bundle

    IBM Rational Data and Application Modeling Bundle 方便地将两种类型的工具打包到一种产品中,为负责开发数据和应用程序的开发人员提供了一种获取所需架构功能的简便方法,全部基于 Eclipse 并具有与 IBM Rational...

    《LATEX 图形宏包介绍》Packages in the ‘graphics’ bundle

    This document serves as a user-manual for the packages color, graphics, and graphicx. Further documentation may be obtained by processing the source (dtx) files of the individual packages.

    电子书版权移除工具eBook DRM Removal Bundle 4.15

    user can view non-drm ebook on iPad, NOOK, Sony Reader or other device without limitation, convert ebook to pdf/doc format in Calibre to print and share ebook with friends. Key Features - Drag Drop ...

    Programming JavaScript Applications

    By applying the design patterns outlined in this book, you’ll learn how to write flexible and resilient code that’s easier—not harder—to work with as your code base grows., JavaScript has become ...

    wxPython 2.8 Application Development Cookbook (含源码)

    Set up the wx main frame by adding your own Frame class to the application Create two stage widgets by using a three step process Set up an event handler, customize, receive and handle events by ...

    files_SPE_bundle.rar

    files_SPE_bundle.rar

    Bundle Adjustment —A Modern Synthesis

    This paper is a survey of the theory and methods of photogrammetric bundle adjustment, aimed at potential implementors in the computer vision community. Bundle adjustment is the problem of refining a ...

    [完美破解]VMProtect Ultimate 3.0.9 Build 695+ WebLM2.4.2.21

    The Professional and Ultimate editions of VMProtect have a console version that supports command line parameters and can be used in automatic building process. It fully supports scripts, watermarks, ...

    Data Analytics and Python Programming 2 Bundle Manuscript

    Data Analytics and Python Programming. Beginners Guide to Learn Data Analytics, Predictive Analytics and Data Science with Python Programming (Hacking Freedom and Data Driven) by Isaac D. Cody English...

    【free】Deep Learning for Computer Vision with Python.zip

    The purpose of the Practitioner Bundle is to build on your knowledge gained from the Starter Bundle and introduce more advanced algorithms, concepts, and tricks of the trade — these tech- niques will...

    ICS delphixe10源码版

    ICS has been designed by Fran鏾is PIETTE but many other peoples are working on the components and sample programs. The history of changes in each source file list all developers having contributed ...

    hadoop the definitive guide 3nd edition

    With this digital Early Release edition of Hadoop: The Definitive Guide, you get the entire book bundle in its earliest form - the author's raw and unedited content - so you can take advantage of this...

    Bundle Adjustment Method using Sparse BFGS Solution

    This letter introduces an efficient bundle adjustment (BA) method based on the sparse Broyden-Fletcher-Goldfarb-Shanno (sparse BFGS, sBFGS) solution, which efficiently estimates camera poses and 3-D ...

    TeeChart2013_131216_SourceCode

    Software) to the extent that they are used separately on the client/workstation side of the network served by the Web Server. 5. License Serial Number. Upon purchase of the SOFTWARE a unique serial...

    cnab-spec:Cloud Native Application Bundle规范

    Cloud Native Application Bundle规格 抽象的 Cloud Native Application Bundles(CNAB)是一种软件包格式规范,它描述了一种用于捆绑,安装和管理分布式应用程序的技术,该技术在设计上是不可知的。 CNAB Core ...

Global site tag (gtag.js) - Google Analytics