1.如果设置self.title = @"首页";这样的话,那么tabbarItem.title和navigationItem.title都会是 “首页”;如果想设置的不一样 就不要用self.title;而是用
infoVC.navigationItem.title = @"第五空间";
infoVC.tabbarItem.title = @"首页";
2.如果美工的tabbarItem给的是图片+文字合在一起的,那么我们用imageinsets来调节按钮图片居中;
nav2.tabBarItem.imageInsets = UIEdgeInsetsMake(6, 0,-6, 0);
3.如果导航栏的title要显示多样化,比如上面1行文字,下面一行文字,并且大小,颜色不一致那么我们就用NSMutableAttributedString
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 40)];
label.numberofLines = 0;
label.textAlignment = NSTextAlignmentCenter;
NSString *str = [NSString stringWithFormat:@"发微博\n%@",@"青春你好"];
//创建一个带有属性的字符串(比如,字体颜色,字体大小,文字样式等)
NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc]initWithString:str];
//添加字体颜色属性
[attrStr addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSMakeRange(0, 2)];
//添加字体大小
[attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:13] range:NSMakeRange(3, 2)];
self.navagationitem.titleView = label;