self.navigationItem.title=@"经销商查询";
UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom];
button.frame=CGRectMake(0, 0, 50, 30);
[button setBackgroundImage:[UIImage p_w_picpathNamed:@"leftItemTap@2x.png"] forState:UIControlStateNormal];
[button setTitle:@"返回" forState:UIControlStateNormal];
button.titleLabel.font=[UIFont systemFontOfSize:14];
button.titleLabel.textAlignment=UITextAlignmentCenter;
button.backgroundColor=[UIColor clearColor];
[button addTarget:self action:@selector(pop) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem * leftButton = [[UIBarButtonItem alloc]initWithCustomView:button];
self.navigationItem.leftBarButtonItem=leftButton;
[leftButton release];
转载于:https://blog.51cto.com/yang120jun/1079103