Bryan Hanson Bryan Hanson - 18 days ago 8
iOS Question

Tab Bar Icon does not appear (what are the restrictions on these?)

Well, this is no doubt silly, but I can't get my tab bar icon to show up.

Here is the code:

- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
// Misc stuff deleted
[self.nibBundle loadNibNamed:nibNameOrNil owner:self options:nibOptions];

if (self) {
self.title = NSLocalizedString(@"Play Game", @"Play Game");
self.tabBarItem.image = [UIImage imageNamed:@"GVC.png"];
}

[self awakeFromNib];
return self;


}

Which, if I give it the name of a too-large icon, the system inserts a blue placeholder. So I think my code is fine (and it looks like everyone elses').

This is for iOS 5 and I have a non-retina display. I have experimented with sizes, including the ideal 30 x 30 size. By the way, all other icons & images are performing properly. The icons are listed in the plist under Icon Files (iOS 5) -> Primary Icon -> Icon Files and the names include .png If I change "Play Game" the app changes accordingly. I've been using Inkscape to make the icons.

So my questions are



  1. Any ideas generally? and,

  2. What are the restrictions on the tab bar icon?




I know size, I gather it must be b/w but have a hard time finding documentation that says so. Any limitations on name, must it be square or can it be rectangular, etc? I've read too that they must be used like an alpha mask but I'm not sure what that really means when I'm making the image.

Answer

As I said, silly. I was not adding the icons to the project from within Xcode... Maybe this will help some other goof ball!