3、系統的圖標太難看了,並且!!點擊只能是系統默認的藍色,找了好久,只能用代碼搞定它了,在四個tabbarController中的第一個顯示的tabbarController的viewDidLoad實現如下代碼: (壓縮包中 3.jpg)
static bool isReseted = false;
- (void)resetTabarItemOnlyOnce{
if (isReseted == false) {
UITabBarController *tabBarVC = self.tabBarController;
NSArray *imageArr = @[@"Home",@"Product",@"Cart",@"Self"];
for (int i=0; i<imageArr.count; i++) {
UITabBarItem *tabBarItem = [tabBarVC.tabBar.items objectAtIndex:i];
tabBarItem.selectedImage = [[UIImage imageNamed:STRING_FORMAT(@"%@-on",imageArr[i])] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
tabBarItem.image = [UIImage imageNamed:STRING_FORMAT(@"%@-off",imageArr[i])];
}
isReseted = true;
NSLog(@"<=== 默認tabbar圖片 ===>");
}else{
NSLog(@"<=== 默認tabbar圖片只會執行一次 ===>");
}
}
NSDictionary *textDic = [NSDictionary dictionaryWithObjectsAndKeys:NavBarColor,NSForegroundColorAttributeName,nil];
[tabBarItem setTitleTextAttributes:textDic forState:UIControlStateSelected];
4、我去,一個下午就這幾句話。。。