设置navigationbar上得字体和颜色

设置navigationbar上标题的字体和颜色

NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor appTextBlackColor], NSForegroundColorAttributeName, [UIFont systemFontOfSize:18], NSFontAttributeName, nil];

 self.navigationController.navigationBar.titleTextAttributes = dict;

 self.navigationItem.title = @"支付密码设置”;


设置navigation item中left,right中字体大小和颜色

 NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor appTextBlackColor], NSForegroundColorAttributeName, [UIFont systemFontOfSize:16], NSFontAttributeName, nil];

 UIBarButtonItem *barButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"忘记密码" style:UIBarButtonItemStylePlain target:self action:@selector(rightBarButtonAction)];

 [barButtonItem setTitleTextAttributes:dict forState:UIControlStateNormal];

 self.navigationItem.rightBarButtonItem = barButtonItem;



你可能感兴趣的:(ios开发记录)