1. 程式人生 > >ios改變導航欄顏色及其字型顏色

ios改變導航欄顏色及其字型顏色

改變系統導航欄顏色 
[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:237/255.0 green:10/255.0 blue:34/255.0 alpha:1.0]];


改變導航欄字型顏色
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:22],
    NSForegroundColorAttributeName:[UIColor
whiteColor]}]; 返回按鈕 UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:nil action:nil]; self.navigationItem.backBarButtonItem = item;