关于uitabbarController

    PEKViewController *viewController = [[PEKViewController alloc] init];

    UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:viewController];

    

    PEKTwoViewController *twoViewController = [[PEKTwoViewController alloc] init];

    UINavigationController *nav2 = [[UINavigationController alloc] initWithRootViewController:twoViewController];

    

    UITabBarController *tabBarController =[[UITabBarController alloc] init];

    tabBarController.viewControllers  = [[NSArray alloc] initWithObjects:nav1,nav2, nil];

    

    UITabBarItem *item1 = [[UITabBarItem alloc] initWithTitle:@"first" image:[UIImage imageNamed:@"dial_item_select.png"] selectedImage:[UIImage imageNamed:@"" ]];

    UITabBarItem *item2 = [[UITabBarItem alloc] initWithTitle:@"two" image:[UIImage imageNamed:@"contact_unselect.png"] selectedImage:[UIImage imageNamed:@""]];

    

    nav1.tabBarItem  = item1;

    nav2.tabBarItem  = item2;

    tabBarController.tabBar.tintColor = [UIColor greenColor];

    self.window.rootViewController = tabBarController;



关于    tabBarController.tabBar.tintColor = [UIColor greenColor];  效果

  关于uitabbarController_第1张图片


看firstTabbarItem的图片的前景色已经改变,在一些特定的场合下,就不需要使用 customTabbarController了

你可能感兴趣的:(关于uitabbarController)