Application Icons

Using an Image as an Icon in Xamarin.iOS.

PDF for offline use:
Sample Code:
Related Articles:

Let us know how you feel about this.


0/250
Thanks for the feedback!

last updated: 2016-12

This article covers including and managing an image asset in a Xamarin.iOS app to be used as an App Icon.

Overview

The following topics will be covered in detail:

Application, Spotlight and Settings Icons

In the same way that a Xamarin.iOS app can use image assets for UI controls and as document icons, image assets can be used to provide Application Icons. The following screenshots from an iPad illustrates the three uses of icons in iOS:

  • Application Icon - Every iOS app must define an application icon. This is the icon that the user will tap from the iOS home screen to launch the app. Additionally, this icon is used by Game Center, if applicable. Example:
  • Spotlight Icon - Whenever the user enters the name of an app in a Spotlight Search, this icon is displayed. Example:
  • Settings Icon - If the user enters the Settings app on their iOS device, this icon will be displayed at the end of the Settings list for the app. Example:

The following image asset sizes and resolutions will be needed to support all of the icon types required by an Xamarin.iOS app targeting iOS 5 through iOS 9 (or greater):

iPhone
iOS 5 & 6 iOS 7 & 8 iOS 9 & 10
(iPhone 6 & 7 Plus)
Icon Type 1x 2x 1x 2x 3x
Application Icon 57x57 114x114 60x60(1) 120x120 180x180
Spotlight 29x29 58x58 40x40(2) 80x80 120x120
Settings 29x29(3)(4) 58x58(3)(4) - - 87x87
iPad
iOS 5 & 6 iOS 7 & 8 iOS 9 & 10
Icon Type 1x 2x 1x 2x 2x
iPad Pro
Application Icon 72x72 144x144 76x76 152x152 167x167(6)
Spotlight 50x50 100x100 40x40 80x80 120x120(5)
Settings 29x29(3)(5) 58x58(3)(5) - - 58x58(5)
  1. Both Xamarin Studio and Xcode no longer support setting 1x image for iOS 7.
  2. Setting a 1x image for iOS 7 is not supported when using Asset Catalogs.
  3. iOS 7 & 8 use the same image sizes as iOS 5 & 6.
  4. Uses the same images and sizes as the Spotlight Icon.
  5. Uses the same size icons as the iPhone.
  6. Only supported with Asset Catalog Image Sets.

For more information about icons, please see Apple's Icon and Image Sizes documentation.

Managing Icons with Asset Catalogs

For icons, a special AppIcons image set can be added to the Assets.xcassets file in the app's project. All version of the image required to support all resolutions are included in the xcasset and grouped together. A special editor in Xamarin Studio allows the developer to include and setup these images graphically.

To use an Asset Catalog, do the following:

  1. Double-click the Info.plist file in the Solution Explorer to open it for editing.
  2. Scroll down to the App Icons section.
  3. From the Source dropdown list, ensure AppIcons is selected:
  4. From the Solution Explorer, double-click the Assets.xcassets file to open it for editing:
  5. Select AppIcons from the list of assets to display the Icon Editor:
  6. Either click on given icon type and select an image file for the required type/size or drag in an image from a folder and drop it on the desired size.
  7. Click the Open button to include the image in the project and set it in the xcasset.
  8. Repeat for all images required.
  1. Double-click the Info.plist file in the Solution Explorer to open it for editing.
  2. Click on the iPhone Icons section:
  3. From the Asset Catalog dropdown list, select AppIcons:
  4. From the Solution Explorer, expand the Asset Catalog folder:
  5. Double-click the Media file to open it in the editor:
  6. Under the Properties Explorer the developer can select the different types and sizes of icons required.
  7. Click on given icon type and select an image file for the required type/size.
  8. Click the Open button to include the image in the project and set it in the xcasset.
  9. Repeat for all images required.

This is the preferred method of including and managing image assets that will be used to provide Application, Spotlight and Settings icons for an app.

iTunes Artwork

If using the Ad-Hoc method of delivering the app (either for corporate users or for beta testing on real devices), the developer also needs to include a 512x512 and a 1024x1024 image that will be used to represent the app in iTunes.

To specify the iTunes Artwork, do the following:

  1. Double-click the Info.plist file in the Solution Explorer to open it for editing.
  2. Scroll to the iTunes Artwork section of the editor:
  3. For any missing image, click on the thumbnail in the editor, select the image file for the desired iTunes artwork from the Open File dialog box and click the OK button.
  4. Repeat this step until all needed images have been specified for the app.
  1. Double-click the Info.plist file in the Solution Explorer to open it for editing.
  2. Select the iPhone Icons section.
  3. Scroll to the iTunes Artwork section of the editor:
  4. For any missing image, click on the thumbnail in the editor, select the image file for the desired iTunes artwork from the Open File dialog box and click the Open button.
  5. Repeat this step until all needed images have been specified for the app.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.