I'm in the process of upgrading my iPhone app to high-res graphics, and I've run into some problems with older devices. The situation involves my UITabBar icons. Have a look:
The top screenshot looks correct. It was captured on the latest generation iPhone (new screen) running OS4. However, the second screenshot is completely wrong. The high-res icons are displaying at 100% size and are getting cropped. That second screenshot was taken from my second-gen iPod touch (old screen) running OS4.
So, I'm really confused here. I've read over Apple's documentation, and as far as I know I'm doing everything they require. Within my app bundle I have images named as:
- tab-featured.png
- [email protected]
- tab-topics.png
- [email protected]
- (...etc...)
Within interface builder, I have specified the low-res version of each image (the filename WITHOUT "@2x") to be used in the tab bar. If I understand iPhone documentation correctly, the device should automatically detect screen resolution and display the high-res version if available. So if anything, it almost seems like my iPod touch is incorrectly detecting its display resolution. Am I missing something here perhaps?
Any help or insight that can be offered would be appreciated! Thanks.
UPDATE:
No luck so far. I took the manual approach and added the following into the viewDidLoad
command of my UITabBarController
:
- (void)viewDidLoad {
[super viewDidLoad];
UITabBarItem *tab;
UIViewController *item;
tab = [[UITabBarItem alloc] initWithTitle:@"Featured" image:[UIImage imageNamed:@"tab-featured.png"] tag:0];
item = [self.viewControllers objectAtIndex:0];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Topics" image:[UIImage imageNamed:@"tab-topics.png"] tag:1];
item = [self.viewControllers objectAtIndex:1];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Video" image:[UIImage imageNamed:@"tab-video.png"] tag:2];
item = [self.viewControllers objectAtIndex:2];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Experts" image:[UIImage imageNamed:@"tab-experts.png"] tag:3];
item = [self.viewControllers objectAtIndex:3];
item.tabBarItem = tab;
[tab release];
tab = [[UITabBarItem alloc] initWithTitle:@"Events" image:[UIImage imageNamed:@"tab-events.png"] tag:4];
item = [self.viewControllers objectAtIndex:4];
item.tabBarItem = tab;
[tab release];
}
This still produces the same result as above (large cut-off icons within the tab bar). Has anyone heard of issues with the UITabBar populating high-res icon pairs?