2009-05-04 61 views

回答

3

你可以在appDelegate.m文件的'applicationDidFinishLaunching:'函數中添加它們。

例如:

NSInteger index = 0; 
while(index < 4){ // 4 is the number of tabbar items 
    UINavigationController *navCtrlr = (UINavigationController*)[[tabBarController viewControllers] objectAtIndex:index]; 
    UITabBarItem *tabBar = (UITabBarItem *) navCtrlr.tabBarItem; 
    if(index == 0){ 
     tabBar.image = [UIImage imageNamed:@"home-item.png"]; 
     tabBar.title = @"home"; 
    } 
    ... 
    index ++; 
}