func addChildViewContoller(title:String,image:String,selectimage:String, vc:UIViewController) {
vc.tabBarItem.title=title//设置tabBarItem标签文字
vc.tabBarItem.image=UIImage(named: image)//设置tabBarItem标签图片
addChildViewController(vc)
}
func addChildViewContoller(title:String,image:String,selectimage:String, vc:UIViewController) {
vc.navigationItem.title=title//设置了导航条标题
let na = UINavigationController(rootViewController: vc)
na.tabBarItem.title=title//设置了tabBarItem标题
addChildViewController(na)
}
func addChildViewContoller(title:String,image:String,selectimage:String, vc:UIViewController) {
vc.title=title//同时设置了导航条标题,tabarbuttom标题
let na = UINavigationController(rootViewController: vc)
addChildViewController(na)
}
func addChildViewContoller(title:String,image:String,selectimage:String, vc:UIViewController) {
vc.tabBarItem.title=title//设置tabarbuttom标题,只有tabBarItem的image有值时,title才会显示。否则好像无限,亲测有效
vc.tabBarItem.image=UIImage(named: image)
let na = UINavigationController(rootViewController: vc)
addChildViewController(na)
}
网友评论