IOS8 下修改TabBar上的按钮的点击颜色

    HomePageViewController *first = [[HomePageViewControlleralloc]init];

    first.tabBarItem = [[UITabBarItemalloc]initWithTitle:@"首页"image:aImageselectedImage:nil];

    UINavigationController *nav1= [[UINavigationControlleralloc]initWithRootViewController:first];


// 2种设置tabbar上的图片的方法:

first.tabBarItem = [[UITabBarItemalloc]initWithTitle:@"首页"image:aImageselectedImage:nil];


first.tabBarController.tabBar.selectedItem.selectedImage = [UIImage imageNamed:@"shouye_sel.png"];


// 设置点击颜色//重要 (ios8)

nav1.tabBarController.tabBar.tintColor = [UIColorblackColor];


// 如果图片是蓝色的话

 UIImage *HPImage2 = [UIImageimageNamed:@"HomePage2.png"];

    HPImage2 = [HPImage2 imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];


// 设置tabbar字体颜色

tabBarController.tabBar.tintColor = [UIColor blackColor];



你可能感兴趣的:(tabbar,点击变色)