在要修改按钮的UIview的Controller里面。
添加下面代码
- (void)addBackBtn{ UIBarButtonItem *backItem = [[UIBarButtonItem alloc] initWithTitle:@"返回" style:UIBarButtonItemStylePlain target:self action:@selector(backtoPre)]; self.navigationItem.leftBarButtonItem = backItem;}- (void)backtoPre{ [self resignFirstResponder]; [self.navigationController popToRootViewControllerAnimated:YES];}