iOSアプリでアイコンを設定する方法
アイコンのファイル名、サイズ一覧についてはこのiOSアイコンファイル早見表がわかりやすかった。
アイコン種別 | ファイル名 | iPhone | iPad | サイズ | 角丸半径 | ||
---|---|---|---|---|---|---|---|
iOS5,6 | iOS7 | iOS5,6 | iOS7 | ||||
アプリアイコン | Icon.png | ○ | 57 x 57 | 10 | |||
Icon@2x.png | ○ | 114 x 114 | 20 | ||||
Icon-72.png | ○ | 72 x 72 | 12 | ||||
Icon-72@2x.png | ○ | 144 x 144 | 24 | ||||
Icon-60.png | 60 x 60 | 13 | |||||
Icon-60@2x.png | ○ | 120 x 120 | 26 | ||||
Icon-76.png | ○ | 76 x 76 | 17 | ||||
Icon-76@2x.png | ○ | 152 x 152 | 34 | ||||
設定・Spotlightアイコン | Icon-Small.png | ○ | ○ | ○ | 29 x 29 | 5 | |
Icon-Small@2x.png | ○ | ○ | ○ | ○ | 58 x 58 | 10 | |
Icon-Small-40.png | ○ | 40 x 40 | 9 | ||||
Icon-Small-40@2x.png | ○ | ○ | 80 x 80 | 18 | |||
Icon-Small-50.png | ○ | 50 x 50 | 9 | ||||
Icon-Small-50@2x.png | ○ | 100 x 100 | 20 | ||||
AppStoreアイコン | iTunesArtwork | ○ | ○ | ○ | ○ | 512 x 512 | 90 |
iTunesArtwork@2x | ○ | ○ | ○ | ○ | 1024 x 1024 | 180 |
アイコンを作成する流れについては、一番サイズが大きいiTunesArtwork@2xを用意してリサイズしていけばよろしいかと。
ちな、リサイズはシェル化しておくと大変便利でよろしいかと。
・iOSアプリのアイコン画像と起動画像をとりあえずつくった
PerlのライブラリImageMagickをサクッと追加。 (よくPHPとかで使うなぁ・・・)
$ brew install imagemagick
あとはviでテキトーな名前で以下のシェルを作成
#!/usr/bin/env bash convert $1 -geometry 40x40 Icon-40.png convert $1 -geometry 80x80 Icon-40@2x.png convert $1 -geometry 60x60 Icon-60.png convert $1 -geometry 120x120 Icon-60@2x.png convert $1 -geometry 72x72 Icon-72.png convert $1 -geometry 144x144 Icon-72@2x.png convert $1 -geometry 76x76 Icon-76.png convert $1 -geometry 152x152 Icon-76@2x.png convert $1 -geometry 50x50 Icon-Small-50.png convert $1 -geometry 100x100 Icon-Small-50@2x.png convert $1 -geometry 29x29 Icon-Small.png convert $1 -geometry 58x58 Icon-Small@2x.png convert $1 -geometry 57x57 Icon.png convert $1 -geometry 114x114 Icon@2x.png
あとは画像ファイルを指定してシェルをバチコーンと叩くだけ。
$ sh hogehoge.sh image-fileName.png
以上!