Friday, 15 May 2015

How to use Adobe Illistrator to create 1x, 2x & 3x image assets automatically for your app

Design or open a vector graphic in Adobe Illustrator at the proper @1x size then go to the File menu and then Save As.


Enter a name for your file and select Adobe PDF (pdf) in the format field.


Make sure you select the following options and the press the Save PDF button
  • Preserve Illustrator Editing Capabilities
  • Embed Page Thumbnails
  • Create Acrobat Layers from Top-Level Layers 

In Xcode select Images.xcassets from the navigation menu then press the + icon and select 'New Image Set'


Give you image set a name


In the Attribute Inspector set Scale Factors to Single Vector

Open finder and drag the pdf document you previously created into the icon space provided in Xcode


Your icon will now display


In the navigation menu select Main.storyboard and drag a UIButton onto the editor.

Select your button and then in the Attribute Inspector delete the default text 'button' and select your image from the Image field.

No comments:

Post a Comment