日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ios项目icon和default图片命名规则

發(fā)布時(shí)間:2023/12/15 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ios项目icon和default图片命名规则 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

一、應(yīng)用圖片
標(biāo)準(zhǔn)iOS控件里的圖片資源,蘋果已經(jīng)做了相應(yīng)的升級,我們需要操心的是應(yīng)用自己的圖片資源。就像當(dāng)初為了支持iPhone 4而制作的@2x高分辨率版本(譯者:以下簡稱高分)圖片一樣,我們要為iPad應(yīng)用中的圖片制作對應(yīng)的高分版本。我知道不少開發(fā)者很有預(yù)見性的早在iOS 5.0 SDK上就完成了這一步升級。可是我還是要強(qiáng)調(diào)一點(diǎn),那就是之前 Michael Jurewitz (@Jury)在推上提到過的:

— 如果想讓你的高分圖片顯示在新iPad上,你必須用Xcode 4.3.1 連同iOS 5.1 SDK編譯!

?

二、應(yīng)用圖標(biāo)

接下來肯定就是為應(yīng)用主圖標(biāo)制作高分版本了,因?yàn)榈头职娴膱D標(biāo)在新iPad桌面上看起來會慘不忍睹。為了支持更多的iOS設(shè)備、更高分辨率的屏幕,iOS開發(fā)者需要為自己的應(yīng)用準(zhǔn)備各種尺寸的主程序圖標(biāo)文件,而且這個(gè)文件列表貌似會越來越長越來越長……(譯者:嘆氣~)。詳情請參考最新的蘋果開發(fā)者文檔?iOS App Programming Guide?和?iOS Human Interface Guidelines?。從官方文檔中,我找出來針對新iPad的Retina顯示屏我們需要準(zhǔn)備的東西:

iPad主應(yīng)用圖標(biāo) (144×144像素):之前用在iPad 1、2代上的是72×72 像素。現(xiàn)在我們需要額外的@2x版本(144×144 像素)。

iPad搜索結(jié)果圖標(biāo) (100×100像素):這個(gè)圖標(biāo)出現(xiàn)在系統(tǒng)搜索結(jié)果中(譯者注:還有在系統(tǒng)設(shè)置中,如果應(yīng)用支持的話)。之前版本用的是50×50像素,現(xiàn)在@2x版本需要100×100像素。

文件命名和Info.plist文件
根據(jù)你的應(yīng)用需要支持的iOS最低版本不同,你可能需要在Info.plist文件中指定圖標(biāo)文件名,或者是按照蘋果的規(guī)范命名不同版本的主圖標(biāo)文件。最悲催的情況恐怕就是,你搞的是一個(gè)即可跑在iPhone也可跑在iPad上的通用應(yīng)用(universal app),并且你打算支持iOS 3.1.x甚至更早的版本(譯者:其實(shí)現(xiàn)在iOS 4.0及以上版本的設(shè)備普及率已經(jīng)很高了,完全沒有必要支持古董級的版本,咱又不是Android)。因?yàn)閕OS 3.2之前是不支持在Info.plist文件里面指定圖標(biāo)文件的,所以你得使用蘋果指定的規(guī)范去命名圖標(biāo)文件。一個(gè)完整的列表差不多就是下面這個(gè)樣子:
● Icon.png – 57×57 iPhone應(yīng)用圖標(biāo)
●?Icon@2x.png?– 114×114 iPhone Retina顯示屏應(yīng)用圖標(biāo)
●?Icon-72.png – 72×72 iPad應(yīng)用圖標(biāo)
●?Icon-72@2x.png??- 144×144 iPad Retina顯示屏應(yīng)用圖標(biāo)
●?Icon-Small.png – 29×29 iPhone 系統(tǒng)設(shè)置和搜索結(jié)果圖標(biāo)
●?Icon-Small@2x.png?– 58×58 iPhone Retina顯示屏 系統(tǒng)設(shè)置和搜索結(jié)果圖標(biāo)
●?Icon-Small-50.png – 50×50 iPad 系統(tǒng)設(shè)置和搜索結(jié)果圖標(biāo)
●?Icon-Small-50@2x.png?– 100×100 iPad Retina顯示屏 系統(tǒng)設(shè)置和搜索結(jié)果圖標(biāo)
?
如果你的應(yīng)用僅兼容iOS 3.2及之后的版本,那么你可以在Info.plist文件里面指定圖標(biāo)文件,你不用遵守上面的命名規(guī)范,當(dāng)然你非要那么命名也沒有問題(譯者:為了便于和美工溝通和日后項(xiàng)目資源的管理,還是建議遵循這套規(guī)范)。在iOS 3.2中,蘋果在Info.plist文件中引入了CFBundleIconFiles鍵,在此其中你可以直接指定應(yīng)用圖標(biāo)的各種版本。如果你忽略了.png的后綴名,那么你也可以忽略高分版本圖片的@2x部分,系統(tǒng)會自動匹配。

蘋果在iOS 5.0中為了支持報(bào)刊雜志(Newsstand)功能,再次引入了一個(gè)新的鍵 CFBundleIcons,這讓事情變得更加復(fù)雜起來(譯者:再次嘆氣~)。這個(gè)鍵下含有子鍵CFBundlePrimaryIcon,里面的CFBundleIconFiles子鍵保存著在此之前保存在Info.plist根節(jié)點(diǎn)CFBundleIconFiles鍵里面的內(nèi)容。如果你的應(yīng)用僅支持iOS 5.0及之后版本,那么用一個(gè) CFBundleIcons鍵就可以,否則的話你還需要同時(shí)保留CFBundleIconFiles鍵和相關(guān)內(nèi)容。

(譯者:這里原文講述稍微有點(diǎn)偏差,未提到CFBundlePrimaryIcon,而且比較混亂,令人費(fèi)解。其實(shí)在Xcode里面以默認(rèn)方式打開Info.plist看到的會是Icon Files和Icon Files(iOS 5)兩組鍵)

總之,為了做到向后兼容,這個(gè)環(huán)節(jié)會給開發(fā)者帶來一點(diǎn)小混亂,相當(dāng)容易犯錯(cuò)。所以,建議開發(fā)者針對不同的設(shè)備、屏幕組合多做測試。
?
三、應(yīng)用商店截屏圖片

蘋果近期對應(yīng)用提交做出了規(guī)則調(diào)整,如若是iPhone、iPod touch應(yīng)用,必須提交Retina顯示屏高分版本的應(yīng)用屏幕截圖。具體圖片尺寸要求如下 (前面的尺寸是含系統(tǒng)狀態(tài)欄情況下的截圖):
- 橫屏: 960×640 或 960×600
- 豎屏: 640×960 或 640×920

目前蘋果尚未對iPad應(yīng)用提交也做出類似要求,但是為了讓你的應(yīng)用截圖在新iPad上看起來呼之欲出,現(xiàn)在是時(shí)候考慮使用高分版本截圖了。對應(yīng)的截圖尺寸如下 (前面的尺寸是含有狀態(tài)欄情況下的截圖):
- 橫屏: 2048×1536 或 2048×1496像素
- 豎屏: 1536×2048 或 1536×2008像素

譯者注:原文評論中有人做了補(bǔ)充的,運(yùn)行時(shí)的載入畫面,針對新iPad屏幕也需要準(zhǔn)備,文件命名和尺寸要求:
- 橫屏: Default-Landscape@2x~ipad.png (2048×1496像素)
- 豎屏: Default-Portrait@2x~ipad.png (1536×2008像素)

?

-----------------------------------------------------------------------------------------------------------------------------

-----------------------------------------------------------------------------------------------------------------------------

ICON 設(shè)置 官網(wǎng)文檔:http://developer.apple.com/library/ios/#qa/qa1686/_index.html

?

iPhone、iPad通用的設(shè)置

圖片大小?(px)

文件名

用途

重要程度

512x512

iTunesArtwork

iTunes 商店中展示

在iTunes中獲取iTunesArtwork圖片

①打開iTunes,點(diǎn)擊左側(cè)的iTunes Store,在選中的應(yīng)用圖標(biāo)上右鍵 拷貝鏈接,

之后在瀏覽器中打開鏈接(這個(gè)鏈接是應(yīng)用在AppStore上的介紹頁面)

如:http://itunes.apple.com/cn/app/pocket-rpg/id411690524?mt=8

②在顯示的頁面中,用瀏覽器上帶的開發(fā)工具,定位到頁面左上角的

175×175的應(yīng)用ICON

如:http://a3.mzstatic.com/us/r1000/089/Purple/43/61/36/mzl.gvbidihl.175x175-75.jpg

之后將這個(gè)鏈接中的175x175改成512x512后,再打開就得到了對應(yīng)的

iTunesArtwork圖片了

http://a3.mzstatic.com/us/r1000/089/Purple/43/61/36/mzl.gvbidihl.512x512-75.jpg

可以沒有,推薦有

如果沒有,在ituens中就不能顯示圖標(biāo),如圖:

未知風(fēng)格,是因?yàn)?Ad Hoc版本,就是測試版,

沒有正式發(fā)布到App Store 上?

57x57

Icon.png

iPhone/iPod touch上的App Store以及Home界面

這個(gè)真得有

114x114

Icon@2x.png

iPhone 4(高分辨率)Home 界面??[App Icons 設(shè)置中的Retina Display] ?

可以沒有,推薦有

72x72

Icon-72.png

兼容iPad的Home界面 ?[App Icons 設(shè)置中的第一個(gè)圖片] ?

可以沒有,推薦有

29x29

Icon-Small.png

Spotlight搜索以及設(shè)置界面

可以沒有,推薦有

50x50

Icon-Small-50.png

兼容iPad的Spotlight搜索

如果有設(shè)置束,最好有

58x58

Icon-Small@2x.png

iPhone 4(高分辨率)的Spotlight搜索和設(shè)置界面

如果有設(shè)置束,最好有

320x480 ? ? ? ? ? ?Default.png??? ? ? ? ? ? ? ? ? ?iPhone4 ?Launch Images ?

640*960 ? ? ? ? ? ?Default@2x.png ? ? ? ? ? ??iPhone4?Launch Images?

768x1024 ? ? ? ? ?Default-Portrait~ipad.png?? ?iPad?Launch Images?

1024x768 ? ? ? ? ?Default-Landscape~ipad.png ?iPad?Launch Images?

Default-Landscape~ipad.png專為iPad的應(yīng)用程序

圖片大小?(px)

文件名

用途

重要程度

512x512

iTunesArtwork

iTunes 商店中展示

可以沒有,推薦有

72x72

Icon-72.png

App Store以及iPad上的Home界面

這個(gè)真得有

29x29

Icon-Small.png

iPad上的設(shè)置界面

如果有設(shè)置束,最好有

50x50

Icon-Small-50.png

兼容iPad的Spotlight搜索

可以沒有,推薦有

?

?

現(xiàn)在不提供iPhone4的必須圖標(biāo)Icon@2x.png,將通不過App Store的審核,所以,現(xiàn)在Icon@2x.png也是必須的了。

iPhone tab bar Item image

Standard display
??30x30 .PNG, 24-bit with transparency (but use only 1 color). Worst case size ~350 bytes. 標(biāo)準(zhǔn)的設(shè)置?tabicon.png??

Retina display?
??60x60 .PNG, 24-bit with transparency (but use only 1 color). Worst case size ~2000 bytes. ? ?tabicon@2x.png

參考轉(zhuǎn)自:http://shy818818.blog.163.com/blog/static/93398309201157104340600/

http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarItem_Class/Reference/Reference.html

iphone啟動頁面,Default.png

延長Default.png顯示的時(shí)間

在delegate.m加入線程延遲

-(Bool)application:(UIApplication *)application didFinishLaunchingWithOptions:??(NSDictionary *)launchOptions

{

? ?[NSThread sleepForTimeInterval:10];

? ?.............

}

應(yīng)用的Default.png圖片顯示的時(shí)間 和 機(jī)器加載應(yīng)用的速度成正比,加載越快,顯示的時(shí)間越短,加載越慢,顯示的時(shí)間越長,

感覺快的話,可以用上面方法延長它的顯示時(shí)間

?

iOS設(shè)備現(xiàn)在有三種不同的分辨率:

iPhone 320x480,?

iPhone 4 640x960,?

iPad 768x1024。

以前程序的啟動畫面(圖片)只要準(zhǔn)備一個(gè)Default.png就可以了,但是現(xiàn)在變得復(fù)雜多了。

如果一個(gè)程序,既支持iPhone又支持iPad,那么它需要包含下面幾個(gè)圖片:

Default-Portrait.png?iPad專用豎向啟動畫面 768x1024或者768x1004

Default-Landscape.png?iPad專用橫向啟動畫面 1024x768或者1024x748

Default-PortraitUpsideDown.png?iPad專用豎向啟動畫面(Home按鈕在屏幕上面),可省略 768x1024或者768x1004

Default-LandscapeLeft.png?iPad專用橫向啟動畫面,可省略 1024x768或者1024x748

Default-LandscapeRight.png?iPad專用橫向啟動畫面,可省略 1024x768或者1024x748

Default.png?iPhone默認(rèn)啟動圖片,320x480或者320x460

Default@2x.png?iPhone4啟動圖片640x960或者640x920

?

為了在iPad上使用上述的啟動畫面,你還需要在info.plist中加入

key: UISupportedInterfaceOrientations。

同時(shí),加入值

UIInterfaceOrientationPortrait

UIInterfaceOrientationPortraitUpsideDown

UIInterfaceOrientationLandscapeLeft

UIInterfaceOrientationLandscapeRight。

iPhone上實(shí)現(xiàn)Default.png動畫

原理:
添加一張和Default.png一樣的圖片,對這個(gè)圖片進(jìn)行動畫,從而實(shí)現(xiàn)Default動畫的漸變消失的效果。
操作:
在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions中添加如下代碼:
?// Make this interesting.
? ? UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];
? ? splashView.image = [UIImage imageNamed:@"Default.png"];
? ? [self.window addSubview:splashView];
? ? [self.window bringSubviewToFront:splashView];
? ? [UIView beginAnimations:nil context:nil];
? ? [UIView setAnimationDuration:2.0];
? ? [UIView setAnimationTransition:UIViewAnimationTransitionNone forView: self.window cache:YES];
? ? [UIView setAnimationDelegate:self];?
? ? [UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];
? ? splashView.alpha = 0.0;
? ? splashView.frame = CGRectMake(-60, -85, 440, 635);
? ? [UIView commitAnimations];
就ok了

?

?

Sizes of?iPhone?UI Elements



Element Size (in points)
Window (including status bar) 320 x 480 pts
Status Bar
(How to hide the status bar)
20 pts
View inside window?
(visible status bar)
320 x 460
Navigation Bar 44 pts
Nav Bar?Image?/
Toolbar Image
up to 20 x 20 pts (transparent PNG)
Tab Bar 49 pts
Tab Bar Icon up to 30 x 30 pts (transparent PNGs)
Text Field 31 pts
Height of a view inside?
a navigation bar
416 pts
Height of a view inside?
a tab bar
411 pts
Height of a view inside?
a navbar?and?a tab bar
367 pts
Portrait Keyboard height 216 pts
Landscape Keyboard height 140 pts
Points vs. Pixels
The iPhone 4 introduced a high resolution display with twice the pixels of previous iPhones. However you don't have to modify your?code?to support high-res displays; the coordinate system goes by points rather than pixels, and the dimensions in points of the screen and all UI elements remain the same.
iOS?4 supports high resolution displays (like the iPhone 4 display) via the?scale?property on UIScreen, UIView, UIImage, and CALayer classes. If the object is displaying high-res content, its scale property is set to 2.0. Otherwise it defaults to 1.0.
All you need to do to support high-res displays is to provide @2x versions of the images in you project. See the?checklist for updating to iOS4?or?Apple?documentation for?Supporting High Resolution Screens?for more info.
Adjusting Sizes
Click here to see how to adjust?View Frames and Bounds.
Additional References
  • Apple Documentation:?Points vs. Pixels
  • Apple Documentation:?UIBarButtonItem Class Reference?says "Typically, the size of a toolbar and navigation bar image is 20 x 20 points."
  • Apple Documentation:?UITabBarItem Class Reference?says "The size of an tab bar image is typically 30 x 30 points."

?

// ----------------------------------------------------------------------------------------------------

?

圓角半徑

iTunes Artwork icon ───────────────────────── 512px (90px)

App icon(iPhone4) ────────────────────────── 114px (20px)

App icon(iPad) ───────────────────────────── 72px (12px)

App icon(iPhone 3G/3GS) ───────────────────── 57px(10px)

Spotlight/Settings icon icon(iPhone4) ───────────── 58px (10px)

Spotlight/Settings icon icon(iPhone 3G/3GS/iPad) ──── 29px (9px)

=====================================================================

?

Designing an app for iPhone, iPad or iPhone4 Here's a couple of things to keep in mind:
iPhone & iPod Touch (1st, 2nd & 3rd Generation)
? ?Portrait: 320 x 480 px, 320 x 480 point
? ?Landscape: 480 x 320 px, 480 x 320 point
? ?Status Bar: 20px, 20point
? ?DPI: 163dpi
? ?Color Mode: 8bit RGB
? ?Color Temperature: Warm
? ?Application icon: 57 x 57 px, 57 x 57 point
? ?Appstore icon: 512 x 512 px, 512 x 512 point
? ?Spotlight search icon: 29 x 29px, 29 x 29 point
? ?Document icon: 22 x 29 px, 22 x 29 point
? ?Webclip icon: 57 x 57 px, 57 x 57 point
? ?Toolbar icon: 20 x 20 px, 20 x 20 point
? ?Tab bar icon: 30 x 30 px, 30 x 30 point
? ?Launch image: ?see above portrait/landscape


iPhone4
? ?Portrait: 640 x 960 px, 320 x 480 point
? ?Landscape: 960 x 640 px, 480 x 320 point
? ?Status Bar: 40px, 20point
? ?DPI: 326dpi
? ?Color Mode: 8bit RGB
? ?Color Temperature: Cool
? ?Application icon: 114 x 114 px, 57 x 57 point
? ?Appstore icon: 512 x 512 px, 512 x 512 point
? ?Spotlight search icon: 58 x 58 px, 29 x 29 point
? ?Document icon: 44 x 58 px, 22 x 29 point
? ?Webclip icon: 114 x 114 px, 57 x 57 point
? ?Toolbar icon: 40 x 40 px, 20 x 20 point
? ?Tab bar icon: ?60 x 60 px, 30 x 30 point
? ?Launch image: ?see above portrait/landscape


Notes: effectively pixel-doubled previous generations, bare in mind the screen is the same size and concessions will have to be made e.g. keeping assets the same *physical size but doubling their effective resolution. see below.*
iPad
? ?Portrait: 768 x 1024px, 768 x 1024point
? ?Landscape: 1024 x 768px, 1024 x 768point
? ?Status Bar: 20px, 20point
? ?DPI: 132dpi
? ?Color Mode: 8bit RGB
? ?Color Temperature: Warm
? ?Application icon: 72 x 72 px, 72 x 72 point
? ?Appstore icon: 512 x 512 px, 512 x 512 point
? ?Spotlight search icon (results): 50 x 50 px, 50 x 50 point
? ?Spotlight search icon (settings): 29 x 29 px, 29 x 29 point
? ?Document icon: 64 x 64 px, 64 x 64 point
? ?Webclip icon: 72 x 72 px, 72 x 72 point
? ?Toolbar icon: 20 x 20 px, 20 x 20 point
? ?Tab bar icon: 30 x 30 px, 30 x 30 point
? ?Launch image: see above portrait/landscape


Notes: many apps include a rounded mask at the corners of the screen/split view - its part of the default view of many apps by the OS. The radius of the rounded corner of these are 6px onto a black background and are optional.
Icon size radii (via Toxinide):
? ?29x29px, border-radius: 5px
? ?50x50px, border-radius: 9px
? ?57x57px, border-radius: 10px
? ?58x58px, border-radius: 10px?
? ?72x72px, border-radius: 12px
? ?114x114px, border-radius: 20px?
? ?512x512px, border-radius: 90px

總結(jié)

以上是生活随笔為你收集整理的ios项目icon和default图片命名规则的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。