Custom UITabBarItem Image/Title on iPhone

15,151

Solution 1

Unfortunately, the only types of UITabBarItems are those supplied and described entirely by the OS (ie, it assigns them icons and titles), and those described entirely by the app, as you've discovered. By far the simplest solution is to pull the icon out of somewhere else and use it with -initWithTitle:image:tag.

http://img369.imageshack.us/img369/8388/openbookwp4.png

Solution 2

As for finding the icons online... I'm still looking for all the official Apple ones myself. Here's what I've found so far:

And instead of screenscraping, do this:

Share:
15,151
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I'd like to add a custom title to one of the predefined UITabBarItems. Whenever I select the particular instance I like in Interface Builder -- if I modify the the title it gets preset back to a 'custom' identifier. Ideally I'd like the book icon from the 'Bookmarks' identifier with my own custom title.

    Is this level of customization currently supported by the SDK? Am I going to have to ultimately screen scrape the image and apply it as a custom image?

    Thanks for any insight or documentation which points me in the right direction.

  • Admin
    Admin over 15 years
    Ben, do you know if the rest of the images are available somewhere? I'd love to grab the magnifying glass also. Heck, I'd purchase custom made ones if they're out there. Thanks!
  • Brian Stormont
    Brian Stormont over 14 years
    Be careful if you use the Apple-supplied tab bar images with different text. Apple may reject the app for HIG violations and potential "user confusion" since the graphic is being used in a non-standard manner. Apple has done such rejections in the past.