一、自定义标题栏button方法
UIBarButtonItem * rightbutton=[[UIBarButtonItem alloc]initWithCustomView:infoButton];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];[button setBackgroundImage:[UIImage imageNamed:@"info.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(selectRightAction:) forControlEvents:UIControlEventTouchUpInside];
button.frame=CGRectMake(0, 0, 30, 30);
UIBarButtonItem * rightbutton=[[UIBarButtonItem alloc]initWithCustomView:button];
self.navigationItem.rightBarButtonItem=rightbutton;
标题栏button的实现:
-(void)selectRightAction:(id)sender{
infoView *infoview=[[infoView alloc]init];
[self.navigationController pushViewController:infoview animated:YES];
//infoview.title=@"关于";
}
二、修改返回键的title