UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame = CGRectMake(0, 0, 44, 30);
[button setImage:[UIImage imageNamed:@"leftArrow"] forState:UIControlStateNormal];
button.imageView.contentMode = UIViewContentModeScaleAspectFit;
[button addTarget:self action:@selector(DismissViewController:) forControlEvents:UIControlEventTouchUpInside];
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:button];
2. 设置导航栏背景图片:
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"grayNavBack"] forBarMetrics:UIBarMetricsDefault];
3. 取消导航栏横线:
[self.navigationController.navigationBar setShadowImage:[UIImage new]];