1 UIButton *backBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 2 [UIPubic initHeadViewBackImgWithBtn:backBtn]; 3 [backBtn addTarget:self action:@selector(backBtnClicked:) forControlEvents:UIControlEventTouchUpInside]; 4 self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
1 self.navigationItem.title = @"CC"; 2 [self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:16],NSForegroundColorAttributeName:[UIColor blackColor]}];
+(void)initHeadViewBackImgWithBtn:(UIView *)sender
{
sender.frame = CGRectMake(15, 10, 22, 22);
sender.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"back"]];
}