設(shè)置App的名稱
設(shè)置App的啟動圖片
需要注意點是,App要殺掉重啟才能顯示出啟動圖片
2種方法防止圖片被渲染
vc02.tabBarItem.image = [UIImage imageNamed:@"tabBar_new_icon"];
UIImage *image = [UIImage imageNamed:@"tabBar_new_click_icon"];
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
vc02.tabBarItem.selectedImage = image;
文字被渲染解決方法
vc02.tabBarItem.title = @"新帖";
NSMutableDictionary *attrs = [NSMutableDictionary dictionary];
attrs[NSForegroundColorAttributeName] = [UIColor grayColor];
[vc02.tabBarItem setTitleTextAttributes:attrs forState:UIControlStateNormal];
NSMutableDictionary *attrs1 = [NSMutableDictionary dictionary];
attrs1[NSForegroundColorAttributeName] = [UIColor blackColor];
[vc02.tabBarItem setTitleTextAttributes:attrs1 forState:UIControlStateSelected];
- 通過appearance統(tǒng)一設(shè)置所有UITabBarItem的文字屬性
- 后面帶有UI_APPEARANCE_SELECTOR的方法,都可以通過appearance對象來統(tǒng)一設(shè)置
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
dic[NSForegroundColorAttributeName] = [UIColor grayColor];
NSMutableDictionary *selectedDic = [NSMutableDictionary dictionary];
selectedDic[NSForegroundColorAttributeName] = [UIColor darkGrayColor];
UITabBarItem *item = [UITabBarItem appearance];
[item setTitleTextAttributes:dic forState:UIControlStateNormal];
[item setTitleTextAttributes:selectedDic forState:UIControlStateSelected];