系统UITabBar属性设置
设置背景:
- [_tabBar setBackgroundImage:[UIImage imageNamed:@"bg_tabbar"]];
设置某个Item选中的效果:
- _tabBar.selectionIndicatorImage = [UIImage imageNamed:@"bar_item_selected"];//设置选中效果图片
设置UITabBarItem文字颜色
- [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor] }
- forState:UIControlStateNormal];
- [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : [UIColor whiteColor] }
- forState:UIControlStateHighlighted];
设置UITabBarItem未选中与选中时的图片:
- [_hotTabItem setFinishedSelectedImage:[UIImage imageNamed:@"1_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"1"]];
- [_searchTabItem setFinishedSelectedImage:[UIImage imageNamed:@"2_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"2"]];
- [_userTabItem setFinishedSelectedImage:[UIImage imageNamed:@"3_selected"] withFinishedUnselectedImage:[UIImage imageNamed:@"3"]];
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步