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;