1.根据下标索引以及控制器索引显示需要显示的控制器
self.selectedIndex
= sender.tag
-
100;
self.selectedViewController
= VC;
2.设置标签控制器下面的文字(这里是设置系统自带的Item)
firstVC.tabBarItem.title
=
@"firstVC";
3.设置背景颜色
self.tabBar.barTintColor
= [UIColor
redColor];
4.设置系统样式图标
UITabBarItem
*tBarItem = [[UITabBarItem
alloc]
initWithTabBarSystemItem:UITabBarSystemItemTopRated
tag:100];
本文介绍如何在 iOS 应用中使用 Swift 设置 UITabBarController 的选中控制器、为 tab bar item 设置标题、更改 tab bar 的背景颜色及设置系统样式的图标。
7271

被折叠的 条评论
为什么被折叠?



