iOS7之後. 默認的返回按鈕字體顏色是藍色的, 顯示內如是父VC(上一級界面)的title
如果要做修改, 可以通過下面的辦法:
(1) 在plist裡面, 加上View controller-based status bar appearance, 並且設置為NO
(2) 在需要修改的那個界面. 加入如下代碼(加在viewDIdLoad即可)<喎?/kf/ware/vc/" target="_blank" class="keylink">vcD4NCjxwcmUgY2xhc3M9"brush:java;">
self.navigationController.navigationBar.barStyle = UIStatusBarStyleDefault;
[self.navigationController.navigationBar setTintColor:[UIColor greenColor]];
或:
//Nav樣式
application.statusBarStyle = UIStatusBarStyleLightContent;
[UINavigationBar appearance].barTintColor =[UIColor colorWithRed:24/255.0 green:30/255.0 blue:43/255.0 alpha:1.0];
[UINavigationBar appearance].tintColor = [UIColor whiteColor];
NSDictionary *NavTextAttribute = @{
//字體顏色
NSForegroundColorAttributeName:[UIColor whiteColor],
//字體大小
NSFontAttributeName:[UIFont boldSystemFontOfSize:18]};
[UINavigationBar appearance].titleTextAttributes = NavTextAttribute;
2.更改UINavgation的navigationItem返回ButtonItem文字
UIBarButtonItem *backItem = [[UIBarButtonItem alloc] init];
backItem.title = @"返回";
self.navigationItem.backBarButtonItem = backItem;