iOS改变NavigationBar的返回键和标题颜色、大小

时间:2021-05-09 06:11:43
     UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[UIPubic initHeadViewBackImgWithBtn:backBtn];
[backBtn addTarget:self action:@selector(backBtnClicked:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
     self.navigationItem.title = @"CC";
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:],NSForegroundColorAttributeName:[UIColor blackColor]}];

+(void)initHeadViewBackImgWithBtn:(UIView *)sender

{

sender.frame = CGRectMake(15, 10, 22, 22);

sender.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"back"]];

}