Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve standard iPhone tabitem images?

I would like to use the standard icons like search, download, contact, setup, and list. Most of them existing in app like App Store, but I am not sure how to retrieve them.

Thanks

like image 275
BlueDolphin Avatar asked Jan 14 '09 01:01

BlueDolphin


3 Answers

See here: http://www.alexcurylo.com/blog/2009/01/03/extracting-sdk-icons/

For example, let’s decide we would like to have a camera image on one of our tabs. So we dig through the simulator resources, which are found at

/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator2.0.sdk/System/Library

and we find one that looks like what we want, inside the above at

/PrivateFrameworks/PhotoLibrary.framework/CameraIcon.png

But wait, it’s not quite that easy! All the allegedly PNG images in the simulator SDK are actually in Apple’s wacky iPhone variation of the PNG format, so we have to deal with that somehow...

[UPDATE: Or, on the other hand, using a camera icon for a camera-related function could actually in Apple’s eyes turn out to be a big bundle of FAIL. So be careful with how you use these icons, kids!]

like image 128
philfreo Avatar answered Oct 21 '22 19:10

philfreo


Not sure if you can do this in Interface Builder, but you can certainly use "system" icons programatically, for example:

[[UITabBarItem alloc] initWithTabBarSystemItem:UITabBarSystemItemDownloads tag:0];

There are a number of other icons:

typedef enum {
   UITabBarSystemItemMore,
   UITabBarSystemItemFavorites,
   UITabBarSystemItemFeatured,
   UITabBarSystemItemTopRated,
   UITabBarSystemItemRecents,
   UITabBarSystemItemContacts,
   UITabBarSystemItemHistory,
   UITabBarSystemItemBookmarks,
   UITabBarSystemItemSearch,
   UITabBarSystemItemDownloads,
   UITabBarSystemItemMostRecent,
   UITabBarSystemItemMostViewed,
} UITabBarSystemItem;

If you want any others I guess you'll have to draw them yourself!

like image 39
Stephen Darlington Avatar answered Oct 21 '22 19:10

Stephen Darlington


And once more, visually: In Interface Builder, select your Tab Bar or Toolbar item and then bring up the Attributes tab in the Inspector (⌘1) and under Identifier, select the system icon you want to use.

like image 39
Aral Balkan Avatar answered Oct 21 '22 19:10

Aral Balkan