本文講下appIcon圖標(biāo)、啟動圖及名字的設(shè)置
icon for iOS 圖標(biāo)大小參照蘋果官網(wǎng):
https://developer.apple.com/library/ios/qa/qa1686/_index.html
兩種方法設(shè)置圖片
1.使用默認(rèn)方法
使用項(xiàng)目的 Images.xcassets:
首先,點(diǎn)擊項(xiàng)目名,設(shè)置一下配置:
設(shè)置成這樣之后,意思是使用使用的assets。去到 Images.xcassets,會發(fā)現(xiàn)多了一個AppIcon的文件夾,右邊有20多個圖標(biāo)位,分別代表不同的手機(jī)屏幕系統(tǒng)需要用的的不同大小分辨率的圖標(biāo),將準(zhǔn)備好的圖標(biāo)拉到對應(yīng)位置就可以了,需要注意的是要對應(yīng)分辨率拖進(jìn)去。
如果你懶得一個個做這么多的圖標(biāo),可以單獨(dú)做一張1024x1024px大小的png,then Use plugin: RTImageAssets
安裝方法:使用插件管理軟件安裝(也可以單獨(dú)在網(wǎng)上下載此插件安裝)
1.plugins manager download address:http://alcatraz.io
2.How to Install:paste the following string to your terminal:
curl -fsSL https://raw.githubusercontent.com/supermarin/Alcatraz/deploy/Scripts/install.sh | sh
restart Xcode, it will be under the menu of window --open the package manager
Then search "RTImageAssets" on this manager's search bar and install it.
After finish,restart Xcode,it will be under menu file--ImageAssets. use and enjoy it.
同理,launchImage 圖片也是如此設(shè)置,先在 Images.xcassets 左下角 的 “+” 號添加文件夾:
然后你會看到右邊也有很多圖片位置,按需求填充就可以了。
然后到項(xiàng)目設(shè)置里:設(shè)置從剛才建的那個文件夾獲取資源就可以了
2.使用自定義方法:
在項(xiàng)目設(shè)置中設(shè)置:
成
然后在項(xiàng)目中新建一個文件夾字叫 icons 和 launchImages ,再將準(zhǔn)備好的圖標(biāo)放里面。這樣也是可以的。
#########ps:其實(shí)發(fā)現(xiàn)什么都不設(shè)置,只要將一張圖片重命名為: icon.png 放在項(xiàng)目中,commad + shift + K 清理下軟件再重新運(yùn)行發(fā)現(xiàn)已可以顯示圖標(biāo)的。
設(shè)置App的名字
1.在項(xiàng)目的Info.plist 文件里面找到 Bundle display name 這一項(xiàng),沒有的話就添加:
然后輸入鍵值就是它的名字了。
2.運(yùn)行 terminal , cd 定位到項(xiàng)目位置后再定位到項(xiàng)目的Info.plist位置,并獲得這個位置路徑:然后執(zhí)行命令:
defaults write /Users/用戶名/項(xiàng)目位置/Info.plist NSdefaults write CFBundleDisplayName App名字
也可以更改App 的名字。
3.info.plist配置方法
上面兩種方法都需要準(zhǔn)備許多種尺寸的icon,因?yàn)橐m應(yīng)不同尺寸的屏幕,下面講的是一種只用幾張尺寸通過plist文件配置就好的方法:
參考:http://blog.devzeng.com/blog/ios-info-dot-plist-config.html